@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.
- package/README.md +11 -16
- package/dist/components/axis.d.ts +47 -47
- package/dist/components/index.d.ts +1 -1
- package/dist/constants.d.ts +11 -11
- package/dist/control/ExtendedCurveInterpolator.d.ts +58 -58
- package/dist/control/IntersectionReferenceSystem.d.ts +96 -96
- package/dist/control/LayerManager.d.ts +76 -76
- package/dist/control/MainController.d.ts +154 -154
- package/dist/control/ZoomPanHandler.d.ts +158 -158
- package/dist/control/index.d.ts +5 -5
- package/dist/control/interfaces.d.ts +37 -37
- package/dist/control/overlay.d.ts +20 -20
- package/dist/datautils/colortable.d.ts +1 -1
- package/dist/datautils/findsample.d.ts +2 -2
- package/dist/datautils/index.d.ts +6 -6
- package/dist/datautils/interfaces.d.ts +63 -63
- package/dist/datautils/picks.d.ts +74 -74
- package/dist/datautils/schematicShapeGenerator.d.ts +59 -61
- package/dist/datautils/seismicimage.d.ts +45 -45
- package/dist/datautils/surfacedata.d.ts +10 -10
- package/dist/datautils/trajectory.d.ts +14 -14
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +7944 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +15 -1
- package/dist/index.umd.js.map +1 -0
- package/dist/interfaces.d.ts +86 -86
- package/dist/layers/CalloutCanvasLayer.d.ts +60 -60
- package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts +22 -22
- package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts +27 -27
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts +20 -20
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts +26 -26
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts +17 -17
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts +24 -24
- package/dist/layers/GeomodelCanvasLayer.d.ts +28 -28
- package/dist/layers/GeomodelLabelsLayer.d.ts +49 -49
- package/dist/layers/GeomodelLayerV2.d.ts +12 -12
- package/dist/layers/GridLayer.d.ts +29 -29
- package/dist/layers/ImageCanvasLayer.d.ts +20 -20
- package/dist/layers/ReferenceLineLayer.d.ts +29 -29
- package/dist/layers/SchematicLayer.d.ts +113 -114
- package/dist/layers/SeismicCanvasLayer.d.ts +18 -18
- package/dist/layers/WellborePathLayer.d.ts +17 -17
- package/dist/layers/base/CanvasLayer.d.ts +19 -19
- package/dist/layers/base/HTMLLayer.d.ts +13 -13
- package/dist/layers/base/Layer.d.ts +69 -69
- package/dist/layers/base/PixiLayer.d.ts +32 -32
- package/dist/layers/base/SVGLayer.d.ts +13 -13
- package/dist/layers/base/index.d.ts +5 -5
- package/dist/layers/index.d.ts +16 -16
- package/dist/layers/schematicInterfaces.d.ts +208 -208
- package/dist/tubing1.svg +3 -0
- package/dist/tubing2.svg +6 -0
- package/dist/tubing3.svg +12 -0
- package/dist/utils/arc-length.d.ts +23 -23
- package/dist/utils/binary-search.d.ts +8 -8
- package/dist/utils/color.d.ts +5 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/root-finder.d.ts +34 -34
- package/dist/utils/text.d.ts +14 -14
- package/dist/utils/vectorUtils.d.ts +15 -15
- package/dist/vendor/pixi-dashed-line/index.d.ts +57 -0
- package/package.json +30 -55
- package/src/datautils/schematicShapeGenerator.ts +2 -8
- package/src/layers/SchematicLayer.ts +12 -37
- package/src/layers/base/PixiLayer.ts +4 -4
- package/src/vendor/pixi-dashed-line/index.ts +394 -0
- package/dist/datautils/camelcase.d.ts +0 -5
- package/dist/index.esm.js +0 -1
- package/dist/index.js +0 -1
- package/src/datautils/camelcase.ts +0 -28
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
|
|
2
|
-
import { Layer } from '../layers';
|
|
3
|
-
import { ControllerOptions } from './interfaces';
|
|
4
|
-
import { ZoomPanHandler } from './ZoomPanHandler';
|
|
5
|
-
import { LayerOptions, OnRescaleEvent, 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<unknown>, params?: LayerOptions<unknown>): 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<unknown>;
|
|
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<Controller>;
|
|
150
|
-
get referenceSystem(): IntersectionReferenceSystem;
|
|
151
|
-
get zoomPanHandler(): ZoomPanHandler;
|
|
152
|
-
get axis(): Axis;
|
|
153
|
-
get currentStateAsEvent(): OnRescaleEvent;
|
|
154
|
-
}
|
|
1
|
+
import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
|
|
2
|
+
import { Layer } from '../layers';
|
|
3
|
+
import { ControllerOptions } from './interfaces';
|
|
4
|
+
import { ZoomPanHandler } from './ZoomPanHandler';
|
|
5
|
+
import { LayerOptions, OnRescaleEvent, 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<unknown>, params?: LayerOptions<unknown>): 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<unknown>;
|
|
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<Controller>;
|
|
150
|
+
get referenceSystem(): IntersectionReferenceSystem;
|
|
151
|
+
get zoomPanHandler(): ZoomPanHandler;
|
|
152
|
+
get axis(): Axis;
|
|
153
|
+
get currentStateAsEvent(): OnRescaleEvent;
|
|
154
|
+
}
|
|
@@ -1,158 +1,158 @@
|
|
|
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
|
-
export 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<HTMLElement, 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: {
|
|
115
|
-
transform: ZoomTransform;
|
|
116
|
-
}): void;
|
|
117
|
-
/**
|
|
118
|
-
* Update scale
|
|
119
|
-
*/
|
|
120
|
-
applyTransform(transform: ZoomTransform): void;
|
|
121
|
-
/**
|
|
122
|
-
* Set new viewport
|
|
123
|
-
* @param cx - center X pos
|
|
124
|
-
* @param cy - center Y pos
|
|
125
|
-
* @param displ
|
|
126
|
-
* @param duration - duration of transition
|
|
127
|
-
* @returns a merge of filter and payload
|
|
128
|
-
*/
|
|
129
|
-
setViewport(cx?: number, cy?: number, displ?: number, duration?: number): void;
|
|
130
|
-
/**
|
|
131
|
-
* Set bounds
|
|
132
|
-
*/
|
|
133
|
-
setBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
134
|
-
/**
|
|
135
|
-
* Set bounds
|
|
136
|
-
*/
|
|
137
|
-
setTranslateBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
138
|
-
/**
|
|
139
|
-
* Adjust zoom due to changes in size of target
|
|
140
|
-
* @param force - force update even if size did not change
|
|
141
|
-
*/
|
|
142
|
-
adjustToSize(width?: number | boolean, height?: number, force?: boolean): void;
|
|
143
|
-
/**
|
|
144
|
-
* Calculate new transform
|
|
145
|
-
* @param dx0
|
|
146
|
-
* @param dx1
|
|
147
|
-
* @param dy
|
|
148
|
-
* @returns New transformation matrix
|
|
149
|
-
*/
|
|
150
|
-
calculateTransform(dx0: number, dx1: number, dy: number): ZoomTransform;
|
|
151
|
-
/**
|
|
152
|
-
* Recalcualate the transform
|
|
153
|
-
*/
|
|
154
|
-
recalculateZoomTransform(): void;
|
|
155
|
-
setZoomLevelBoundary(zoomlevels: [number, number]): ZoomPanHandler;
|
|
156
|
-
setMaxZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
157
|
-
setMinZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
158
|
-
}
|
|
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
|
+
export 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<HTMLElement, 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: {
|
|
115
|
+
transform: ZoomTransform;
|
|
116
|
+
}): void;
|
|
117
|
+
/**
|
|
118
|
+
* Update scale
|
|
119
|
+
*/
|
|
120
|
+
applyTransform(transform: ZoomTransform): void;
|
|
121
|
+
/**
|
|
122
|
+
* Set new viewport
|
|
123
|
+
* @param cx - center X pos
|
|
124
|
+
* @param cy - center Y pos
|
|
125
|
+
* @param displ
|
|
126
|
+
* @param duration - duration of transition
|
|
127
|
+
* @returns a merge of filter and payload
|
|
128
|
+
*/
|
|
129
|
+
setViewport(cx?: number, cy?: number, displ?: number, duration?: number): void;
|
|
130
|
+
/**
|
|
131
|
+
* Set bounds
|
|
132
|
+
*/
|
|
133
|
+
setBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
134
|
+
/**
|
|
135
|
+
* Set bounds
|
|
136
|
+
*/
|
|
137
|
+
setTranslateBounds(xBounds: [number, number], yBounds: [number, number]): void;
|
|
138
|
+
/**
|
|
139
|
+
* Adjust zoom due to changes in size of target
|
|
140
|
+
* @param force - force update even if size did not change
|
|
141
|
+
*/
|
|
142
|
+
adjustToSize(width?: number | boolean, height?: number, force?: boolean): void;
|
|
143
|
+
/**
|
|
144
|
+
* Calculate new transform
|
|
145
|
+
* @param dx0
|
|
146
|
+
* @param dx1
|
|
147
|
+
* @param dy
|
|
148
|
+
* @returns New transformation matrix
|
|
149
|
+
*/
|
|
150
|
+
calculateTransform(dx0: number, dx1: number, dy: number): ZoomTransform;
|
|
151
|
+
/**
|
|
152
|
+
* Recalcualate the transform
|
|
153
|
+
*/
|
|
154
|
+
recalculateZoomTransform(): void;
|
|
155
|
+
setZoomLevelBoundary(zoomlevels: [number, number]): ZoomPanHandler;
|
|
156
|
+
setMaxZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
157
|
+
setMinZoomLevel(zoomlevel: number): ZoomPanHandler;
|
|
158
|
+
}
|
package/dist/control/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './interfaces';
|
|
2
|
-
export * from './IntersectionReferenceSystem';
|
|
3
|
-
export * from './LayerManager';
|
|
4
|
-
export * from './MainController';
|
|
5
|
-
export * from './ZoomPanHandler';
|
|
1
|
+
export * from './interfaces';
|
|
2
|
+
export * from './IntersectionReferenceSystem';
|
|
3
|
+
export * from './LayerManager';
|
|
4
|
+
export * from './MainController';
|
|
5
|
+
export * from './ZoomPanHandler';
|