@equinor/esv-intersection 3.0.4 → 3.0.7
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 +18 -3
- package/dist/components/axis.d.ts +48 -0
- package/dist/components/axis.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/control/ExtendedCurveInterpolator.d.ts +59 -0
- package/dist/control/ExtendedCurveInterpolator.d.ts.map +1 -0
- package/dist/control/IntersectionReferenceSystem.d.ts +97 -0
- package/dist/control/IntersectionReferenceSystem.d.ts.map +1 -0
- package/dist/control/LayerManager.d.ts +77 -0
- package/dist/control/LayerManager.d.ts.map +1 -0
- package/dist/control/MainController.d.ts +155 -0
- package/dist/control/MainController.d.ts.map +1 -0
- package/dist/control/ZoomPanHandler.d.ts +159 -0
- package/dist/control/ZoomPanHandler.d.ts.map +1 -0
- package/dist/control/index.d.ts +6 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/interfaces.d.ts +38 -0
- package/dist/control/interfaces.d.ts.map +1 -0
- package/dist/control/overlay.d.ts +21 -0
- package/dist/control/overlay.d.ts.map +1 -0
- package/dist/datautils/colortable.d.ts +2 -0
- package/dist/datautils/colortable.d.ts.map +1 -0
- package/dist/datautils/findsample.d.ts +3 -0
- package/dist/datautils/findsample.d.ts.map +1 -0
- package/dist/datautils/index.d.ts +7 -0
- package/dist/datautils/index.d.ts.map +1 -0
- package/dist/datautils/interfaces.d.ts +64 -0
- package/dist/datautils/interfaces.d.ts.map +1 -0
- package/dist/datautils/picks.d.ts +75 -0
- package/dist/datautils/picks.d.ts.map +1 -0
- package/dist/datautils/schematicShapeGenerator.d.ts +60 -0
- package/dist/datautils/schematicShapeGenerator.d.ts.map +1 -0
- package/dist/datautils/seismicimage.d.ts +46 -0
- package/dist/datautils/seismicimage.d.ts.map +1 -0
- package/dist/datautils/surfacedata.d.ts +11 -0
- package/dist/datautils/surfacedata.d.ts.map +1 -0
- package/dist/datautils/trajectory.d.ts +15 -0
- package/dist/datautils/trajectory.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +162 -160
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/interfaces.d.ts +1 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/layers/CalloutCanvasLayer.d.ts +61 -0
- package/dist/layers/CalloutCanvasLayer.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts +22 -0
- package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts +24 -0
- package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts +21 -0
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts +27 -0
- package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts +18 -0
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts.map +1 -0
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts +25 -0
- package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts.map +1 -0
- package/dist/layers/GeomodelCanvasLayer.d.ts +29 -0
- package/dist/layers/GeomodelCanvasLayer.d.ts.map +1 -0
- package/dist/layers/GeomodelLabelsLayer.d.ts +50 -0
- package/dist/layers/GeomodelLabelsLayer.d.ts.map +1 -0
- package/dist/layers/GeomodelLayerV2.d.ts +13 -0
- package/dist/layers/GeomodelLayerV2.d.ts.map +1 -0
- package/dist/layers/GridLayer.d.ts +30 -0
- package/dist/layers/GridLayer.d.ts.map +1 -0
- package/dist/layers/ImageCanvasLayer.d.ts +21 -0
- package/dist/layers/ImageCanvasLayer.d.ts.map +1 -0
- package/dist/layers/ReferenceLineLayer.d.ts +30 -0
- package/dist/layers/ReferenceLineLayer.d.ts.map +1 -0
- package/dist/layers/SchematicLayer.d.ts +114 -0
- package/dist/layers/SchematicLayer.d.ts.map +1 -0
- package/dist/layers/SeismicCanvasLayer.d.ts +19 -0
- package/dist/layers/SeismicCanvasLayer.d.ts.map +1 -0
- package/dist/layers/WellborePathLayer.d.ts +18 -0
- package/dist/layers/WellborePathLayer.d.ts.map +1 -0
- package/dist/layers/base/CanvasLayer.d.ts +20 -0
- package/dist/layers/base/CanvasLayer.d.ts.map +1 -0
- package/dist/layers/base/HTMLLayer.d.ts +14 -0
- package/dist/layers/base/HTMLLayer.d.ts.map +1 -0
- package/dist/layers/base/Layer.d.ts +70 -0
- package/dist/layers/base/Layer.d.ts.map +1 -0
- package/dist/layers/base/PixiLayer.d.ts +33 -0
- package/dist/layers/base/PixiLayer.d.ts.map +1 -0
- package/dist/layers/base/SVGLayer.d.ts +14 -0
- package/dist/layers/base/SVGLayer.d.ts.map +1 -0
- package/dist/layers/base/index.d.ts +6 -0
- package/dist/layers/base/index.d.ts.map +1 -0
- package/dist/layers/index.d.ts +17 -0
- package/dist/layers/index.d.ts.map +1 -0
- package/dist/layers/schematicInterfaces.d.ts +210 -0
- package/dist/layers/schematicInterfaces.d.ts.map +1 -0
- package/dist/utils/arc-length.d.ts +24 -0
- package/dist/utils/arc-length.d.ts.map +1 -0
- package/dist/utils/binary-search.d.ts +9 -0
- package/dist/utils/binary-search.d.ts.map +1 -0
- package/dist/utils/color.d.ts +6 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/root-finder.d.ts +35 -0
- package/dist/utils/root-finder.d.ts.map +1 -0
- package/dist/utils/text.d.ts +15 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/vectorUtils.d.ts +16 -0
- package/dist/utils/vectorUtils.d.ts.map +1 -0
- package/dist/vendor/pixi-dashed-line/index.d.ts +57 -0
- package/dist/vendor/pixi-dashed-line/index.d.ts.map +1 -0
- package/package.json +29 -21
- package/src/.eslintrc.json +5 -0
- package/src/components/axis.ts +247 -0
- package/src/components/index.ts +1 -0
- package/src/control/ExtendedCurveInterpolator.ts +155 -0
- package/src/control/IntersectionReferenceSystem.ts +391 -0
- package/src/control/LayerManager.ts +294 -0
- package/src/control/MainController.ts +296 -0
- package/src/control/ZoomPanHandler.ts +436 -0
- package/src/control/index.ts +5 -0
- package/src/control/interfaces.ts +42 -0
- package/src/control/overlay.ts +118 -0
- package/src/datautils/colortable.ts +14 -0
- package/src/datautils/findsample.ts +72 -0
- package/src/datautils/index.ts +6 -0
- package/src/datautils/interfaces.ts +68 -0
- package/src/datautils/picks.ts +328 -0
- package/src/datautils/schematicShapeGenerator.ts +1008 -0
- package/src/datautils/seismicimage.ts +180 -0
- package/src/datautils/surfacedata.ts +317 -0
- package/src/datautils/trajectory.ts +206 -0
- package/src/layers/CalloutCanvasLayer.ts +338 -0
- package/src/layers/CustomDisplayObjects/ComplexRope.ts +44 -0
- package/src/layers/CustomDisplayObjects/ComplexRopeGeometry.ts +184 -0
- package/src/layers/CustomDisplayObjects/FixedWidthSimpleRope.ts +41 -0
- package/src/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.ts +149 -0
- package/src/layers/CustomDisplayObjects/UniformTextureStretchRope.ts +39 -0
- package/src/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.ts +174 -0
- package/src/layers/GeomodelCanvasLayer.ts +176 -0
- package/src/layers/GeomodelLabelsLayer.ts +615 -0
- package/src/layers/GeomodelLayerV2.ts +111 -0
- package/src/layers/GridLayer.ts +145 -0
- package/src/layers/ImageCanvasLayer.ts +55 -0
- package/src/layers/ReferenceLineLayer.ts +185 -0
- package/src/layers/SchematicLayer.ts +870 -0
- package/src/layers/SeismicCanvasLayer.ts +46 -0
- package/src/layers/WellborePathLayer.ts +129 -0
- package/src/layers/base/CanvasLayer.ts +102 -0
- package/src/layers/base/HTMLLayer.ts +70 -0
- package/src/layers/base/Layer.ts +217 -0
- package/src/layers/base/PixiLayer.ts +190 -0
- package/src/layers/base/SVGLayer.ts +63 -0
- package/src/layers/base/index.ts +5 -0
- package/src/layers/index.ts +16 -0
- package/src/layers/schematicInterfaces.ts +472 -0
- package/src/tsconfig.json +9 -0
- package/src/utils/arc-length.ts +66 -0
- package/src/utils/binary-search.ts +26 -0
- package/src/utils/color.ts +22 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/root-finder.ts +78 -0
- package/src/utils/text.ts +88 -0
- package/src/utils/vectorUtils.ts +67 -0
- package/src/vendor/pixi-dashed-line/index.ts +390 -0
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://badge.fury.io/js/%40equinor%2Fesv-intersection)
|
|
2
|
+
|
|
2
3
|
# ESV Intersection component
|
|
4
|
+
|
|
3
5
|
A reusable component to create intersection visualizations for wells
|
|
4
6
|
|
|
5
7
|
Part of the [Equinor Subsurface Visualization project](https://github.com/equinor/esv)
|
|
@@ -13,33 +15,41 @@ Part of the [Equinor Subsurface Visualization project](https://github.com/equino
|
|
|
13
15
|
## Getting started
|
|
14
16
|
|
|
15
17
|
#### Installation
|
|
18
|
+
|
|
16
19
|
Using npm:
|
|
20
|
+
|
|
17
21
|
```bash
|
|
18
22
|
npm install --save @equinor/esv-intersection
|
|
19
23
|
```
|
|
24
|
+
|
|
20
25
|
Using yarn:
|
|
26
|
+
|
|
21
27
|
```bash
|
|
22
28
|
yarn add @equinor/esv-intersection
|
|
23
29
|
```
|
|
30
|
+
|
|
24
31
|
To run application in your machine :
|
|
32
|
+
|
|
25
33
|
```bash
|
|
26
34
|
$ git clone git@github.com:equinor/esv-intersection
|
|
27
35
|
$ git submodule update --init --recursive
|
|
28
36
|
$ npm run storybook
|
|
29
37
|
```
|
|
38
|
+
|
|
30
39
|
#### Usage
|
|
31
40
|
|
|
32
41
|
```javascript
|
|
33
42
|
import { Controller, GridLayer } from '@equinor/esv-intersection';
|
|
34
43
|
|
|
35
44
|
const container = document.createElement('div');
|
|
36
|
-
const controller = new Controller({container: container});
|
|
45
|
+
const controller = new Controller({ container: container });
|
|
37
46
|
|
|
38
47
|
// the controller initially has zero height
|
|
39
48
|
controller.adjustToSize(400, 400);
|
|
40
49
|
|
|
41
50
|
controller.addLayer(new GridLayer('grid'));
|
|
42
51
|
```
|
|
52
|
+
|
|
43
53
|
For more examples, check out our stories in our online [storybook](https://equinor.github.io/esv-intersection/storybook/latest).
|
|
44
54
|
|
|
45
55
|
## Technical choices
|
|
@@ -53,24 +63,27 @@ For more examples, check out our stories in our online [storybook](https://equin
|
|
|
53
63
|
- Browser support: Target Edge, Chrome, Firefox, Safari
|
|
54
64
|
- Linting and unit tests run automatically on Github Actions
|
|
55
65
|
|
|
56
|
-
|
|
57
66
|
## Development
|
|
67
|
+
|
|
58
68
|
- 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
69
|
- New features could be requested by opening a dedicated issue or, even better, by opening a [Pull Requests](CONTRIBUTION.md)
|
|
60
70
|
|
|
61
|
-
|
|
62
71
|
## Support
|
|
72
|
+
|
|
63
73
|
If you are an Equinor employee, the easiest way to get in touch with the maintainers is through the #esv-intersection channel on Slack.
|
|
64
74
|
|
|
65
75
|
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.
|
|
66
76
|
|
|
67
77
|
### Help needed
|
|
78
|
+
|
|
68
79
|
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
|
|
69
80
|
|
|
70
81
|
### Bug reports
|
|
82
|
+
|
|
71
83
|
Follow the instructions from the _Help needed_ section above, but also include precise instructions about how to reproduce the bug. If any data is required for reproducing the bug, it would be beneficial to have access to it as well.
|
|
72
84
|
|
|
73
85
|
### Feature requests
|
|
86
|
+
|
|
74
87
|
Give a precise description of your use case. It would be best if you could formulate your request as a user story, using the format `As a <subject> I would like to <the feature you need> so that <the task you want to accomplish>`
|
|
75
88
|
|
|
76
89
|
## Contribution
|
|
@@ -78,7 +91,9 @@ Give a precise description of your use case. It would be best if you could formu
|
|
|
78
91
|
See the contribution [page](CONTRIBUTION.md)
|
|
79
92
|
|
|
80
93
|
## License
|
|
94
|
+
|
|
81
95
|
The large majority of the files in this repository are released under the [MIT license](LICENSE). There are 2 exceptions:
|
|
96
|
+
|
|
82
97
|
- the [CONTRIBUTION.md](CONTRIBUTION.md) file, which uses _BSD 2-Clause "Simplified" License_, as described at the end of the file itself
|
|
83
98
|
- the content of the [esv-intersection-data](https://github.com/equinor/esv-intersection-data) submodule uses the same license as Equinor's [Volve dataset](https://data.equinor.com/dataset/Volve), which is also available in the submodule
|
|
84
99
|
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
}
|
|
48
|
+
//# sourceMappingURL=axis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../../src/components/axis.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,aAAa,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I;IAMlB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9B,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKnC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAOtE,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,EAEzB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,EAEzB;IAED,IAAI,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAExC;IAED,IAAI,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAExC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,kBAAkB,IAAI,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CurveInterpolator } from 'curve-interpolator';
|
|
2
|
+
import { Vector } from 'curve-interpolator/dist/src/core/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
|
+
}
|
|
59
|
+
//# sourceMappingURL=ExtendedCurveInterpolator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtendedCurveInterpolator.d.ts","sourceRoot":"","sources":["../../../src/control/ExtendedCurveInterpolator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAM1F,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,eAAe,EAAE,MAAM,EAAE,CAAM;gBAEnB,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,wBAAwB;IAahE;;;;;OAKG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAa1H;;;;;OAKG;IACH,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,SAAO,EAAE,UAAU,SAAM,GAAG,MAAM;IAWtF;;;OAGG;IACH,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAK7E;;;OAGG;IACH,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAWjD,uBAAuB,CAAC,QAAQ,GAAE,MAAa,GAAG,IAAI;IAYtD;;;;OAIG;IACH,YAAY,CAAC,IAAI,SAAI,EAAE,EAAE,SAAI,GAAG,MAAM;IAQtC;;;;OAIG;IACH,iBAAiB,CAAC,IAAI,SAAI,EAAE,EAAE,SAAI,GAAG,MAAM;IAyB3C;;;OAGG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAKnH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAIvC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
}
|
|
97
|
+
//# sourceMappingURL=IntersectionReferenceSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntersectionReferenceSystem.d.ts","sourceRoot":"","sources":["../../../src/control/IntersectionReferenceSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAa,MAAM,oBAAoB,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c,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IAQxC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,UAAQ,GAAG,OAAO,EAAE;IA0BlF;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAmBvC;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAO1C;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IAOrC;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAI,EAAE,EAAE,SAAI,GAAG,UAAU;IAqD1D;;OAEG;IACH,qBAAqB,CACnB,SAAS,EAAE,MAAM,EACjB,oBAAoB,SAA8B,EAClD,kBAAkB,SAA4B,GAC7C,UAAU;IA0Cb,mBAAmB,IAAI,MAAM,EAAE;IAgB/B;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,SAAI,GAAG,MAAM,EAAE,EAAE;IAajE;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;IAO9F,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAGxB;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
}
|
|
77
|
+
//# sourceMappingURL=LayerManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerManager.d.ts","sourceRoot":"","sources":["../../../src/control/LayerManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAa,YAAY,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAgC,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA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;IAKxB,cAAc,IAAI,YAAY;IAK9B,cAAc,IAAI,YAAY;IAK9B,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY;IAWjD,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY;IASvC,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY;IASvC,oBAAoB,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY;IAKhE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAKhD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAKhD,OAAO,IAAI,YAAY;IAavB,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,UAAU,CAgBhB;CACH"}
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
}
|
|
155
|
+
//# sourceMappingURL=MainController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainController.d.ts","sourceRoot":"","sources":["../../../src/control/MainController.ts"],"names":[],"mappings":"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