@equinor/esv-intersection 2.1.0 → 3.0.0-beta.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.
- package/package.json +32 -30
- package/dist/components/axis.d.ts +0 -48
- package/dist/components/index.d.ts +0 -1
- package/dist/constants.d.ts +0 -8
- package/dist/control/ExtendedCurveInterpolator.d.ts +0 -58
- package/dist/control/IntersectionReferenceSystem.d.ts +0 -81
- package/dist/control/LayerManager.d.ts +0 -76
- package/dist/control/MainController.d.ts +0 -154
- package/dist/control/ZoomPanHandler.d.ts +0 -157
- package/dist/control/index.d.ts +0 -5
- package/dist/control/interfaces.d.ts +0 -37
- package/dist/control/overlay.d.ts +0 -21
- package/dist/datautils/camelcase.d.ts +0 -5
- package/dist/datautils/colortable.d.ts +0 -1
- package/dist/datautils/findsample.d.ts +0 -2
- package/dist/datautils/index.d.ts +0 -6
- package/dist/datautils/interfaces.d.ts +0 -57
- package/dist/datautils/picks.d.ts +0 -10
- package/dist/datautils/seismicimage.d.ts +0 -32
- package/dist/datautils/surfacedata.d.ts +0 -10
- package/dist/datautils/trajectory.d.ts +0 -14
- package/dist/datautils/wellboreItemShapeGenerator.d.ts +0 -22
- package/dist/index.d.ts +0 -6
- package/dist/index.esm.js +0 -15
- package/dist/index.js +0 -15
- package/dist/index.umd.js +0 -399
- package/dist/interfaces.d.ts +0 -186
- package/dist/layers/CalloutCanvasLayer.d.ts +0 -52
- package/dist/layers/CasingLayer.d.ts +0 -21
- package/dist/layers/CementLayer.d.ts +0 -15
- package/dist/layers/CompletionLayer.d.ts +0 -21
- package/dist/layers/GeomodelCanvasLayer.d.ts +0 -27
- package/dist/layers/GeomodelLabelsLayer.d.ts +0 -37
- package/dist/layers/GeomodelLayer.d.ts +0 -7
- package/dist/layers/GeomodelLayerV2.d.ts +0 -13
- package/dist/layers/GridLayer.d.ts +0 -17
- package/dist/layers/HoleSizeLayer.d.ts +0 -11
- package/dist/layers/ImageCanvasLayer.d.ts +0 -9
- package/dist/layers/SeismicCanvasLayer.d.ts +0 -8
- package/dist/layers/WellboreBaseComponentLayer.d.ts +0 -26
- package/dist/layers/WellborePathLayer.d.ts +0 -10
- package/dist/layers/base/CanvasLayer.d.ts +0 -19
- package/dist/layers/base/HTMLLayer.d.ts +0 -13
- package/dist/layers/base/Layer.d.ts +0 -49
- package/dist/layers/base/PixiLayer.d.ts +0 -28
- package/dist/layers/base/SVGLayer.d.ts +0 -13
- package/dist/layers/base/index.d.ts +0 -5
- package/dist/layers/index.d.ts +0 -18
- package/dist/utils/arc-length.d.ts +0 -23
- package/dist/utils/binary-search.d.ts +0 -8
- package/dist/utils/color.d.ts +0 -5
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/root-finder.d.ts +0 -34
- package/dist/utils/text.d.ts +0 -14
- package/dist/utils/vectorUtils.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/esv-intersection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Intersection component package with testing and automatic documentation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"build": "rollup -c",
|
|
15
15
|
"prepub": "npm run build",
|
|
16
16
|
"pub": "npm publish --access=public",
|
|
17
|
-
"
|
|
17
|
+
"pub-beta": "npm publish --tag=beta --access=public",
|
|
18
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx src test",
|
|
18
19
|
"test": "tsc --project tsconfig.test.json && jest",
|
|
19
20
|
"test:watch": "jest --watchAll",
|
|
20
21
|
"predocs": "rimraf docs_out",
|
|
@@ -40,38 +41,39 @@
|
|
|
40
41
|
},
|
|
41
42
|
"homepage": "https://github.com/equinor/esv-intersection#readme",
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@babel/core": "^7.
|
|
44
|
-
"@babel/preset-env": "^7.
|
|
45
|
-
"@babel/preset-typescript": "^7.
|
|
46
|
-
"@storybook/addon-docs": "^6.
|
|
47
|
-
"@storybook/addon-storysource": "^6.
|
|
48
|
-
"@storybook/html": "^6.
|
|
49
|
-
"@types/d3": "^7.
|
|
50
|
-
"@types/jest": "^
|
|
51
|
-
"@types/mock-raf": "^1.0.
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
53
|
-
"@typescript-eslint/parser": "^
|
|
54
|
-
"babel-jest": "^
|
|
44
|
+
"@babel/core": "^7.19.1",
|
|
45
|
+
"@babel/preset-env": "^7.19.1",
|
|
46
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
47
|
+
"@storybook/addon-docs": "^6.5.12",
|
|
48
|
+
"@storybook/addon-storysource": "^6.5.12",
|
|
49
|
+
"@storybook/html": "^6.5.12",
|
|
50
|
+
"@types/d3": "^7.4.0",
|
|
51
|
+
"@types/jest": "^29.0.2",
|
|
52
|
+
"@types/mock-raf": "^1.0.3",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
|
54
|
+
"@typescript-eslint/parser": "^5.37.0",
|
|
55
|
+
"babel-jest": "^29.0.3",
|
|
55
56
|
"copyfiles": "^2.4.1",
|
|
56
|
-
"eslint": "^
|
|
57
|
-
"eslint-config-prettier": "^8.
|
|
58
|
-
"eslint-plugin-prettier": "^
|
|
59
|
-
"eslint-plugin-storybook": "^0.
|
|
60
|
-
"jest": "^
|
|
61
|
-
"jest-canvas-mock": "^2.
|
|
57
|
+
"eslint": "^8.23.1",
|
|
58
|
+
"eslint-config-prettier": "^8.5.0",
|
|
59
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
60
|
+
"eslint-plugin-storybook": "^0.6.4",
|
|
61
|
+
"jest": "^29.0.3",
|
|
62
|
+
"jest-canvas-mock": "^2.4.0",
|
|
63
|
+
"jest-environment-jsdom": "^29.0.3",
|
|
62
64
|
"mock-raf": "^1.0.1",
|
|
63
|
-
"pixi.js": "^6.
|
|
64
|
-
"prettier": "^2.
|
|
65
|
+
"pixi.js": "^6.5.8",
|
|
66
|
+
"prettier": "^2.7.1",
|
|
65
67
|
"rimraf": "^3.0.2",
|
|
66
|
-
"rollup": "^2.
|
|
68
|
+
"rollup": "^2.79.0",
|
|
67
69
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
68
70
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
69
71
|
"rollup-plugin-terser": "^7.0.2",
|
|
70
|
-
"rollup-plugin-typescript2": "^0.
|
|
71
|
-
"storybook-dark-mode": "^1.
|
|
72
|
-
"tslib": "^2.
|
|
73
|
-
"typedoc": "^0.
|
|
74
|
-
"typescript": "^4.
|
|
72
|
+
"rollup-plugin-typescript2": "^0.34.0",
|
|
73
|
+
"storybook-dark-mode": "^1.1.2",
|
|
74
|
+
"tslib": "^2.4.0",
|
|
75
|
+
"typedoc": "^0.23.14",
|
|
76
|
+
"typescript": "^4.8.3"
|
|
75
77
|
},
|
|
76
78
|
"jest": {
|
|
77
79
|
"setupFiles": [
|
|
@@ -89,10 +91,10 @@
|
|
|
89
91
|
]
|
|
90
92
|
},
|
|
91
93
|
"peerDependencies": {
|
|
92
|
-
"pixi.js": "^6.
|
|
94
|
+
"pixi.js": "^6.5.8"
|
|
93
95
|
},
|
|
94
96
|
"dependencies": {
|
|
95
|
-
"@equinor/videx-math": "^1.0
|
|
97
|
+
"@equinor/videx-math": "^1.1.0",
|
|
96
98
|
"@equinor/videx-vector2": "^1.0.44",
|
|
97
99
|
"curve-interpolator": "2.0.8",
|
|
98
100
|
"d3-array": "^3.2.0",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ScaleLinear } from 'd3-scale';
|
|
3
|
-
import { OnResizeEvent, OnRescaleEvent } from '../interfaces';
|
|
4
|
-
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, any, 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
|
-
}
|
|
48
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './axis';
|
package/dist/constants.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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 HOLE_OUTLINE = 1;
|
|
6
|
-
export declare const SHOE_WIDTH = 25;
|
|
7
|
-
export declare const SHOE_LENGTH = 12;
|
|
8
|
-
export declare const SURFACE_LINE_WIDTH = 1;
|
|
@@ -1,58 +0,0 @@
|
|
|
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,81 +0,0 @@
|
|
|
1
|
-
import { Interpolators, Trajectory, ReferenceSystemOptions, MDPoint } from '../interfaces';
|
|
2
|
-
export declare class IntersectionReferenceSystem {
|
|
3
|
-
options: ReferenceSystemOptions;
|
|
4
|
-
path: number[][];
|
|
5
|
-
projectedPath: number[][];
|
|
6
|
-
projectedTrajectory: number[][];
|
|
7
|
-
private _offset;
|
|
8
|
-
displacement: number;
|
|
9
|
-
depthReference: number;
|
|
10
|
-
wellboreId: number;
|
|
11
|
-
trajectoryOffset: number;
|
|
12
|
-
interpolators: Interpolators;
|
|
13
|
-
startVector: number[];
|
|
14
|
-
endVector: number[];
|
|
15
|
-
_curtainPathCache: MDPoint[];
|
|
16
|
-
/**
|
|
17
|
-
* Creates a common reference system that layers and other components can use
|
|
18
|
-
* @param path (required) array of 3d coordinates: [x, y, z]
|
|
19
|
-
* @param options (optional)
|
|
20
|
-
* @param options.trajectoryAngle (optional) - trajectory angle in degrees, overrides the calculated value
|
|
21
|
-
* @param options.calculateDisplacementFromBottom - (optional) specify if the path is passed from bottom up
|
|
22
|
-
*/
|
|
23
|
-
constructor(path: number[][], options?: ReferenceSystemOptions);
|
|
24
|
-
private setPath;
|
|
25
|
-
/**
|
|
26
|
-
* Map a length along the curve to intersection coordinates
|
|
27
|
-
* @param length length along the curve
|
|
28
|
-
*/
|
|
29
|
-
project(length: number): number[];
|
|
30
|
-
curtainTangent(length: number): number[];
|
|
31
|
-
/**
|
|
32
|
-
* Returns as resampled version of the projected path between start and end
|
|
33
|
-
* Samples are picked from the beginning of the path at every CURTAIN_SAMPLING_INTERVAL meters
|
|
34
|
-
* If the angle between two consecutive segments is close to 180 degrees depending on CURTAIN_SAMPLING_ANGLE_THRESHOLD,
|
|
35
|
-
* a sample in between is discarded.
|
|
36
|
-
*
|
|
37
|
-
* The start and the end are not guaranteed to be part of the returned set of points
|
|
38
|
-
* @param start in MD
|
|
39
|
-
* @param end in MD
|
|
40
|
-
*/
|
|
41
|
-
getCurtainPath(start: number, end: number): MDPoint[];
|
|
42
|
-
/**
|
|
43
|
-
* Map a displacement back to length along the curve
|
|
44
|
-
*/
|
|
45
|
-
unproject(displacement: number): number;
|
|
46
|
-
/**
|
|
47
|
-
* Get the normalized displacement [0 - 1] of a specific length along the curve
|
|
48
|
-
*/
|
|
49
|
-
getProjectedLength(length: number): number;
|
|
50
|
-
/**
|
|
51
|
-
* Get the trajectory position at a length along the curve
|
|
52
|
-
*/
|
|
53
|
-
getPosition(length: number): number[];
|
|
54
|
-
/**
|
|
55
|
-
* Generate a set of coordinates along the trajectory of the curve
|
|
56
|
-
*/
|
|
57
|
-
getTrajectory(steps: number, from?: number, to?: number): Trajectory;
|
|
58
|
-
/**
|
|
59
|
-
* Generate a set of coordinates along the trajectory of the curve
|
|
60
|
-
*/
|
|
61
|
-
getExtendedTrajectory(numPoints: number, startExtensionLength?: number, endExtensionLength?: number): Trajectory;
|
|
62
|
-
getTrajectoryVector(): number[];
|
|
63
|
-
/**
|
|
64
|
-
* Perform a curtain projection on a set of points in 3D
|
|
65
|
-
* @param points
|
|
66
|
-
* @param origin
|
|
67
|
-
* @param offset
|
|
68
|
-
* @returns {array}
|
|
69
|
-
*/
|
|
70
|
-
static toDisplacement(points: number[][], offset?: number): number[][];
|
|
71
|
-
/**
|
|
72
|
-
* returns a normalized vector
|
|
73
|
-
* @param interpolator interpolated curve
|
|
74
|
-
* @param from number between 0 and 1
|
|
75
|
-
* @param to number between 0 and 1
|
|
76
|
-
*/
|
|
77
|
-
static getDirectionVector(interpolator: any, from: number, to: number): number[];
|
|
78
|
-
get length(): number;
|
|
79
|
-
get offset(): number;
|
|
80
|
-
set offset(offset: number);
|
|
81
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ZoomPanHandler } from './ZoomPanHandler';
|
|
2
|
-
import { Layer } 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[]): LayerManager;
|
|
26
|
-
/**
|
|
27
|
-
* Gets all layers currently mounted
|
|
28
|
-
*/
|
|
29
|
-
getLayers(): Layer[];
|
|
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, params?: any): 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;
|
|
51
|
-
initLayer(layer: Layer, params?: any): 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,154 +0,0 @@
|
|
|
1
|
-
import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
|
|
2
|
-
import { Layer } from '../layers';
|
|
3
|
-
import { ControllerOptions } from './interfaces';
|
|
4
|
-
import { ZoomPanHandler } from './ZoomPanHandler';
|
|
5
|
-
import { ReferenceSystemOptions } from '..';
|
|
6
|
-
import { Axis } from '../components';
|
|
7
|
-
import { Overlay } from './overlay';
|
|
8
|
-
/**
|
|
9
|
-
* API for controlling data and layers
|
|
10
|
-
*/
|
|
11
|
-
export declare class Controller {
|
|
12
|
-
private _referenceSystem;
|
|
13
|
-
private layerManager;
|
|
14
|
-
private _overlay;
|
|
15
|
-
/**
|
|
16
|
-
* Interface to control layers, reference system, axis and overlay. overlay is created on instantiation, does not currently support opt-out.
|
|
17
|
-
* @param options
|
|
18
|
-
* @param options.container (required) Currently only supports HTMLElement
|
|
19
|
-
* @param options.scaleOptions (optional) currently supports formats listed in examples below
|
|
20
|
-
* @example scaleOptions = { xMin: 0, xMax: 100, yMin: 0, yMax: 100 }
|
|
21
|
-
* @example scaleOptions = { xBounds: [0 , 100], yBounds: [0, 100] }
|
|
22
|
-
* @param options.axisOptions (optional) creates axis with supplied labels, currently only supports creating axis on instantiation
|
|
23
|
-
* @param options.layers (optional) list of layers
|
|
24
|
-
* @param options.path (optional) creates a reference system based on an array of 3d coordinates
|
|
25
|
-
* @param options.referenceSystem (optional) sets reference system, takes priority over path if both are supplied
|
|
26
|
-
*/
|
|
27
|
-
constructor(options: ControllerOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Sets reference system, overrides any existing reference systems in place
|
|
30
|
-
* @param referenceSystem IntersectionReferenceSystem
|
|
31
|
-
*/
|
|
32
|
-
setReferenceSystem(referenceSystem: IntersectionReferenceSystem): Controller;
|
|
33
|
-
/**
|
|
34
|
-
* Creates new reference system based on path, overrides any existing reference systems in place
|
|
35
|
-
* @param path array of coords
|
|
36
|
-
* @param options optional
|
|
37
|
-
* @param options.trajectoryAngle (optional) angle in degrees
|
|
38
|
-
*/
|
|
39
|
-
updatePath(path: number[][], options?: ReferenceSystemOptions): Controller;
|
|
40
|
-
/**
|
|
41
|
-
* Clears data from all mounted layers
|
|
42
|
-
* @param includeReferenceSystem - (optional) if true also removes reference system, default is true
|
|
43
|
-
*/
|
|
44
|
-
clearAllData(includeReferenceSystem?: boolean): Controller;
|
|
45
|
-
/**
|
|
46
|
-
* Adds layer to list, and initializes it
|
|
47
|
-
* @param layer layer object
|
|
48
|
-
* @param params (optional) adds additional parameters to the onUpdateEvent
|
|
49
|
-
*/
|
|
50
|
-
addLayer(layer: Layer, params?: any): Controller;
|
|
51
|
-
/**
|
|
52
|
-
* Remove and unmount layer from list
|
|
53
|
-
* @param layerId string id
|
|
54
|
-
*/
|
|
55
|
-
removeLayer(layerId: string): Controller;
|
|
56
|
-
/**
|
|
57
|
-
* Remove and unmount all layers from list
|
|
58
|
-
*/
|
|
59
|
-
removeAllLayers(): Controller;
|
|
60
|
-
/**
|
|
61
|
-
* Find first layer with given id, returns undefined if none are found
|
|
62
|
-
* @param layerId string id
|
|
63
|
-
*/
|
|
64
|
-
getLayer(layerId: string): Layer;
|
|
65
|
-
/**
|
|
66
|
-
* Sets visibility to true and rescales the layer
|
|
67
|
-
* @param layerId string id
|
|
68
|
-
*/
|
|
69
|
-
showLayer(layerId: string): Controller;
|
|
70
|
-
/**
|
|
71
|
-
* Sets visibility to false
|
|
72
|
-
* @param layerId string id
|
|
73
|
-
*/
|
|
74
|
-
hideLayer(layerId: string): Controller;
|
|
75
|
-
/**
|
|
76
|
-
* Adjust layers, axis, overlay, and zoom according to inputted dimensions
|
|
77
|
-
* @param width (required)
|
|
78
|
-
* @param height (required)
|
|
79
|
-
*/
|
|
80
|
-
adjustToSize(width: number, height: number): Controller;
|
|
81
|
-
/**
|
|
82
|
-
* Set new viewport
|
|
83
|
-
* @param cx - center X pos
|
|
84
|
-
* @param cy - center Y pos
|
|
85
|
-
* @param displ - displacement
|
|
86
|
-
* @param duration - duration of transition
|
|
87
|
-
*/
|
|
88
|
-
setViewport(cx?: number, cy?: number, displacement?: number, duration?: number): Controller;
|
|
89
|
-
/**
|
|
90
|
-
* Sets bounds for zoom and pan handler
|
|
91
|
-
* @param xBounds - domain in x-direction
|
|
92
|
-
* @param yBounds - domain in y-direction
|
|
93
|
-
*/
|
|
94
|
-
setBounds(xBounds: [number, number], yBounds: [number, number]): Controller;
|
|
95
|
-
/**
|
|
96
|
-
* Display both axes
|
|
97
|
-
*/
|
|
98
|
-
showAxis(): Controller;
|
|
99
|
-
/**
|
|
100
|
-
* Hide both axes
|
|
101
|
-
*/
|
|
102
|
-
hideAxis(): Controller;
|
|
103
|
-
/**
|
|
104
|
-
* Shows labels in x and y
|
|
105
|
-
*/
|
|
106
|
-
showAxisLabels(): Controller;
|
|
107
|
-
/**
|
|
108
|
-
* Hide labels in x and y
|
|
109
|
-
*/
|
|
110
|
-
hideAxisLabels(): Controller;
|
|
111
|
-
/**
|
|
112
|
-
* Sets domain offset, offset is subtracted from domain
|
|
113
|
-
* @param x
|
|
114
|
-
* @param y
|
|
115
|
-
*/
|
|
116
|
-
setAxisOffset(x: number, y: number): Controller;
|
|
117
|
-
/**
|
|
118
|
-
* Sets domain offset in x-direction, offset is subtracted from domain
|
|
119
|
-
* @param x
|
|
120
|
-
*/
|
|
121
|
-
setXAxisOffset(x: number): Controller;
|
|
122
|
-
/**
|
|
123
|
-
* Sets domain offset in y-direction, offset is subtracted from domain
|
|
124
|
-
* @param y
|
|
125
|
-
*/
|
|
126
|
-
setYAxisOffset(y: number): Controller;
|
|
127
|
-
/**
|
|
128
|
-
* Defines min and max of how much one can zoom
|
|
129
|
-
* @param zoomlevels
|
|
130
|
-
*/
|
|
131
|
-
setZoomLevelBoundary(zoomlevels: [number, number]): Controller;
|
|
132
|
-
/**
|
|
133
|
-
* Defines how far in one can zoom
|
|
134
|
-
* @param zoomlevel
|
|
135
|
-
*/
|
|
136
|
-
setMaxZoomLevel(zoomlevel: number): Controller;
|
|
137
|
-
/**
|
|
138
|
-
* Defines how far out one can zoom
|
|
139
|
-
* @param zoomlevel
|
|
140
|
-
*/
|
|
141
|
-
setMinZoomLevel(zoomlevel: number): Controller;
|
|
142
|
-
/**
|
|
143
|
-
* Destroy Controller
|
|
144
|
-
* Convenience method for removing from DOM and clearing references
|
|
145
|
-
*/
|
|
146
|
-
destroy(): Controller;
|
|
147
|
-
private getHighestZIndex;
|
|
148
|
-
private setOverlayZIndex;
|
|
149
|
-
get overlay(): Overlay;
|
|
150
|
-
get referenceSystem(): IntersectionReferenceSystem;
|
|
151
|
-
get zoomPanHandler(): ZoomPanHandler;
|
|
152
|
-
get axis(): Axis;
|
|
153
|
-
get currentStateAsEvent(): any;
|
|
154
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ScaleLinear } from 'd3-scale';
|
|
3
|
-
import { ZoomBehavior, ZoomTransform } from 'd3-zoom';
|
|
4
|
-
import { ZoomAndPanOptions, OnRescaleEvent } from '../interfaces';
|
|
5
|
-
declare type RescaleFunction = (event: OnRescaleEvent) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Handle zoom and pan for intersection layers
|
|
8
|
-
*/
|
|
9
|
-
export declare class ZoomPanHandler {
|
|
10
|
-
zoom: ZoomBehavior<Element, unknown>;
|
|
11
|
-
elm: HTMLElement;
|
|
12
|
-
container: Selection<any, unknown, null, undefined>;
|
|
13
|
-
onRescale: RescaleFunction;
|
|
14
|
-
options: ZoomAndPanOptions;
|
|
15
|
-
xBounds: [number, number];
|
|
16
|
-
yBounds: [number, number];
|
|
17
|
-
translateBoundsX: [number, number];
|
|
18
|
-
translateBoundsY: [number, number];
|
|
19
|
-
scaleX: ScaleLinear<number, number>;
|
|
20
|
-
scaleY: ScaleLinear<number, number>;
|
|
21
|
-
_zFactor: number;
|
|
22
|
-
_enableTranslateExtent: boolean;
|
|
23
|
-
currentTransform: ZoomTransform;
|
|
24
|
-
/**
|
|
25
|
-
* Constructor
|
|
26
|
-
* @param elm, -
|
|
27
|
-
* @param options - options
|
|
28
|
-
*/
|
|
29
|
-
constructor(elm: HTMLElement, onRescale: RescaleFunction, options?: ZoomAndPanOptions);
|
|
30
|
-
/**
|
|
31
|
-
* Getter returning width of target
|
|
32
|
-
* @returns width
|
|
33
|
-
*/
|
|
34
|
-
get width(): number;
|
|
35
|
-
/**
|
|
36
|
-
* Getter returning height of target
|
|
37
|
-
* @returns height
|
|
38
|
-
*/
|
|
39
|
-
get height(): number;
|
|
40
|
-
/**
|
|
41
|
-
* Getter which calculate span from x bounds
|
|
42
|
-
* @returns x span
|
|
43
|
-
*/
|
|
44
|
-
get xSpan(): number;
|
|
45
|
-
/**
|
|
46
|
-
* Calculate span from y bounds
|
|
47
|
-
* @returns y span
|
|
48
|
-
*/
|
|
49
|
-
get ySpan(): number;
|
|
50
|
-
/**
|
|
51
|
-
* Ratio between height and width
|
|
52
|
-
* @returns ratio
|
|
53
|
-
*/
|
|
54
|
-
get viewportRatio(): number;
|
|
55
|
-
/**
|
|
56
|
-
* x ratios screen to value ratio
|
|
57
|
-
* @returns ratio
|
|
58
|
-
*/
|
|
59
|
-
get xRatio(): number;
|
|
60
|
-
/**
|
|
61
|
-
* y scale screen to value ratio
|
|
62
|
-
* @returns ratio
|
|
63
|
-
*/
|
|
64
|
-
get yRatio(): number;
|
|
65
|
-
/**
|
|
66
|
-
* Get z-factor
|
|
67
|
-
* @returns z-factor
|
|
68
|
-
*/
|
|
69
|
-
get zFactor(): number;
|
|
70
|
-
/**
|
|
71
|
-
* Set z factor
|
|
72
|
-
* @param factor
|
|
73
|
-
*/
|
|
74
|
-
set zFactor(factor: number);
|
|
75
|
-
/**
|
|
76
|
-
* Check if x is inverted (right to left is positive) from x bounds
|
|
77
|
-
* @returns true if inverted
|
|
78
|
-
*/
|
|
79
|
-
get isXInverted(): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Check if y is inverted (bottom to top is positive) from y bounds
|
|
82
|
-
* @returns true if inverted
|
|
83
|
-
*/
|
|
84
|
-
get isYInverted(): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Get if enable translate extent (pan limit)
|
|
87
|
-
* @returns true if enabled
|
|
88
|
-
*/
|
|
89
|
-
get enableTranslateExtent(): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Set enable translate extent (pan limit)
|
|
92
|
-
* @param enabled - If should be enabled
|
|
93
|
-
*/
|
|
94
|
-
set enableTranslateExtent(enabled: boolean);
|
|
95
|
-
/**
|
|
96
|
-
* Update translate extent (pan limits)
|
|
97
|
-
*/
|
|
98
|
-
updateTranslateExtent(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Create an event object from current state
|
|
101
|
-
*/
|
|
102
|
-
currentStateAsEvent(): OnRescaleEvent;
|
|
103
|
-
/**
|
|
104
|
-
* Update scale
|
|
105
|
-
*/
|
|
106
|
-
rescale(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Initialized handler
|
|
109
|
-
*/
|
|
110
|
-
init(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Handle zoom
|
|
113
|
-
*/
|
|
114
|
-
onZoom(event: any): void;
|
|
115
|
-
/**
|
|
116
|
-
* Update scale
|
|
117
|
-
*/
|
|
118
|
-
applyTransform(transform: ZoomTransform): void;
|
|
119
|
-
/**
|
|
120
|
-
* Set new viewport
|
|
121
|
-
* @param cx - center X pos
|
|
122
|
-
* @param cy - center Y pos
|
|
123
|
-
* @param displ
|
|
124
|
-
* @param duration - duration of transition
|
|
125
|
-
* @returns a merge of filter and payload
|
|
126
|
-
*/
|
|
127
|
-
setViewport(cx?: number, cy?: number, displ?: number, duration?: number): void;
|
|
128
|
-
/**
|
|
129
|
-
* Set bounds
|
|
130
|
-
*/
|
|
131
|
-
setBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
132
|
-
/**
|
|
133
|
-
* Set bounds
|
|
134
|
-
*/
|
|
135
|
-
setTranslateBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
136
|
-
/**
|
|
137
|
-
* Adjust zoom due to changes in size of target
|
|
138
|
-
* @param force - force update even if size did not change
|
|
139
|
-
*/
|
|
140
|
-
adjustToSize(width?: number | boolean, height?: number, force?: boolean): void;
|
|
141
|
-
/**
|
|
142
|
-
* Calculate new transform
|
|
143
|
-
* @param dx0
|
|
144
|
-
* @param dx1
|
|
145
|
-
* @param dy
|
|
146
|
-
* @returns New transformation matrix
|
|
147
|
-
*/
|
|
148
|
-
calculateTransform(dx0: number, dx1: number, dy: number): ZoomTransform;
|
|
149
|
-
/**
|
|
150
|
-
* Recalcualate the transform
|
|
151
|
-
*/
|
|
152
|
-
recalculateZoomTransform(): void;
|
|
153
|
-
setZoomLevelBoundary(zoomlevels: [number, number]): ZoomPanHandler;
|
|
154
|
-
setMaxZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
155
|
-
setMinZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
156
|
-
}
|
|
157
|
-
export {};
|