@equinor/esv-intersection 3.0.11 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/components/axis.d.ts +47 -0
  2. package/dist/components/axis.d.ts.map +1 -0
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/components/index.d.ts.map +1 -0
  5. package/dist/constants.d.ts +12 -0
  6. package/dist/constants.d.ts.map +1 -0
  7. package/dist/control/ExtendedCurveInterpolator.d.ts +1 -0
  8. package/dist/control/ExtendedCurveInterpolator.d.ts.map +1 -0
  9. package/dist/control/IntersectionReferenceSystem.d.ts +93 -0
  10. package/dist/control/IntersectionReferenceSystem.d.ts.map +1 -0
  11. package/dist/control/LayerManager.d.ts +77 -0
  12. package/dist/control/LayerManager.d.ts.map +1 -0
  13. package/dist/control/MainController.d.ts +155 -0
  14. package/dist/control/MainController.d.ts.map +1 -0
  15. package/dist/control/ZoomPanHandler.d.ts +160 -0
  16. package/dist/control/ZoomPanHandler.d.ts.map +1 -0
  17. package/dist/control/index.d.ts +6 -0
  18. package/dist/control/index.d.ts.map +1 -0
  19. package/dist/control/interfaces.d.ts +37 -0
  20. package/dist/control/interfaces.d.ts.map +1 -0
  21. package/dist/control/overlay.d.ts +21 -0
  22. package/dist/control/overlay.d.ts.map +1 -0
  23. package/dist/datautils/colortable.d.ts +2 -0
  24. package/dist/datautils/colortable.d.ts.map +1 -0
  25. package/dist/datautils/findsample.d.ts +3 -0
  26. package/dist/datautils/findsample.d.ts.map +1 -0
  27. package/dist/datautils/index.d.ts +7 -0
  28. package/dist/datautils/index.d.ts.map +1 -0
  29. package/dist/datautils/interfaces.d.ts +64 -0
  30. package/dist/datautils/interfaces.d.ts.map +1 -0
  31. package/dist/datautils/picks.d.ts +75 -0
  32. package/dist/datautils/picks.d.ts.map +1 -0
  33. package/dist/datautils/schematicShapeGenerator.d.ts +60 -0
  34. package/dist/datautils/schematicShapeGenerator.d.ts.map +1 -0
  35. package/dist/datautils/seismicimage.d.ts +46 -0
  36. package/dist/datautils/seismicimage.d.ts.map +1 -0
  37. package/dist/datautils/surfacedata.d.ts +11 -0
  38. package/dist/datautils/surfacedata.d.ts.map +1 -0
  39. package/dist/datautils/trajectory.d.ts +15 -0
  40. package/dist/datautils/trajectory.d.ts.map +1 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/interfaces.d.ts +1 -0
  44. package/dist/interfaces.d.ts.map +1 -0
  45. package/dist/layers/CalloutCanvasLayer.d.ts +61 -0
  46. package/dist/layers/CalloutCanvasLayer.d.ts.map +1 -0
  47. package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts +22 -0
  48. package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts.map +1 -0
  49. package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts +24 -0
  50. package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts.map +1 -0
  51. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts +21 -0
  52. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts.map +1 -0
  53. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts +27 -0
  54. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts.map +1 -0
  55. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts +18 -0
  56. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts.map +1 -0
  57. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts +25 -0
  58. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts.map +1 -0
  59. package/dist/layers/GeomodelCanvasLayer.d.ts +29 -0
  60. package/dist/layers/GeomodelCanvasLayer.d.ts.map +1 -0
  61. package/dist/layers/GeomodelLabelsLayer.d.ts +50 -0
  62. package/dist/layers/GeomodelLabelsLayer.d.ts.map +1 -0
  63. package/dist/layers/GeomodelLayerV2.d.ts +13 -0
  64. package/dist/layers/GeomodelLayerV2.d.ts.map +1 -0
  65. package/dist/layers/GridLayer.d.ts +30 -0
  66. package/dist/layers/GridLayer.d.ts.map +1 -0
  67. package/dist/layers/ImageCanvasLayer.d.ts +21 -0
  68. package/dist/layers/ImageCanvasLayer.d.ts.map +1 -0
  69. package/dist/layers/ReferenceLineLayer.d.ts +29 -0
  70. package/dist/layers/ReferenceLineLayer.d.ts.map +1 -0
  71. package/dist/layers/SchematicLayer.d.ts +114 -0
  72. package/dist/layers/SchematicLayer.d.ts.map +1 -0
  73. package/dist/layers/SeismicCanvasLayer.d.ts +19 -0
  74. package/dist/layers/SeismicCanvasLayer.d.ts.map +1 -0
  75. package/dist/layers/WellborePathLayer.d.ts +18 -0
  76. package/dist/layers/WellborePathLayer.d.ts.map +1 -0
  77. package/dist/layers/base/CanvasLayer.d.ts +20 -0
  78. package/dist/layers/base/CanvasLayer.d.ts.map +1 -0
  79. package/dist/layers/base/HTMLLayer.d.ts +14 -0
  80. package/dist/layers/base/HTMLLayer.d.ts.map +1 -0
  81. package/dist/layers/base/Layer.d.ts +70 -0
  82. package/dist/layers/base/Layer.d.ts.map +1 -0
  83. package/dist/layers/base/PixiLayer.d.ts +33 -0
  84. package/dist/layers/base/PixiLayer.d.ts.map +1 -0
  85. package/dist/layers/base/SVGLayer.d.ts +14 -0
  86. package/dist/layers/base/SVGLayer.d.ts.map +1 -0
  87. package/dist/layers/base/index.d.ts +6 -0
  88. package/dist/layers/base/index.d.ts.map +1 -0
  89. package/dist/layers/index.d.ts +17 -0
  90. package/dist/layers/index.d.ts.map +1 -0
  91. package/dist/layers/schematicInterfaces.d.ts +210 -0
  92. package/dist/layers/schematicInterfaces.d.ts.map +1 -0
  93. package/dist/utils/arc-length.d.ts +1 -0
  94. package/dist/utils/arc-length.d.ts.map +1 -0
  95. package/dist/utils/binary-search.d.ts +1 -0
  96. package/dist/utils/binary-search.d.ts.map +1 -0
  97. package/dist/utils/color.d.ts +6 -0
  98. package/dist/utils/color.d.ts.map +1 -0
  99. package/dist/utils/index.d.ts +2 -0
  100. package/dist/utils/index.d.ts.map +1 -0
  101. package/dist/utils/root-finder.d.ts +1 -0
  102. package/dist/utils/root-finder.d.ts.map +1 -0
  103. package/dist/utils/text.d.ts +15 -0
  104. package/dist/utils/text.d.ts.map +1 -0
  105. package/dist/utils/vectorUtils.d.ts +16 -0
  106. package/dist/utils/vectorUtils.d.ts.map +1 -0
  107. package/dist/vendor/pixi-dashed-line/index.d.ts +57 -0
  108. package/dist/vendor/pixi-dashed-line/index.d.ts.map +1 -0
  109. package/package.json +1 -1
@@ -0,0 +1,47 @@
1
+ import { ScaleLinear } from 'd3-scale';
2
+ import { OnResizeEvent, OnRescaleEvent } from '../interfaces';
3
+ export type Options = {
4
+ offsetX: number;
5
+ offsetY: number;
6
+ visible: boolean;
7
+ };
8
+ export declare class Axis {
9
+ private mainGroup;
10
+ private _scaleX;
11
+ private _scaleY;
12
+ private _showLabels;
13
+ private _labelXDesc;
14
+ private _labelYDesc;
15
+ private _unitOfMeasure;
16
+ private _offsetX;
17
+ private _offsetY;
18
+ private _flipX;
19
+ private _flipY;
20
+ private visible;
21
+ constructor(mainGroup: Axis['mainGroup'], showLabels: boolean | undefined, labelXDesc: string, labelYDesc: string, unitOfMeasure: string, options?: Options);
22
+ private renderLabelx;
23
+ private renderLabely;
24
+ private renderGy;
25
+ private renderGx;
26
+ private createOrGet;
27
+ render(): void;
28
+ onResize(event: OnResizeEvent): void;
29
+ onRescale(event: OnRescaleEvent): void;
30
+ show(): Axis;
31
+ hide(): Axis;
32
+ flipX(flipX: boolean): Axis;
33
+ flipY(flipY: boolean): Axis;
34
+ showLabels(): Axis;
35
+ hideLabels(): Axis;
36
+ setLabelX(label: string): Axis;
37
+ setLabelY(label: string): Axis;
38
+ setUnitOfMeasure(uom: string): Axis;
39
+ setLabels(labelX: string, labelY: string, unitOfMeasure: string): Axis;
40
+ get offsetX(): number;
41
+ set offsetX(offset: number);
42
+ get offsetY(): number;
43
+ set offsetY(offset: number);
44
+ get scaleX(): ScaleLinear<number, number>;
45
+ get scaleY(): ScaleLinear<number, number>;
46
+ }
47
+ //# sourceMappingURL=axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/components/axis.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,qBAAa,IAAI;IACf,OAAO,CAAC,SAAS,CAAqD;IACtE,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAQ;gBAEX,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,UAAU,qBAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;IAqB7I,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,WAAW,CAOjB;IAEF,MAAM,IAAI,IAAI;IAKd,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAIpC,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAmBtC,IAAI,IAAI,IAAI;IAOZ,IAAI,IAAI,IAAI;IAMZ,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAQ3B,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAQ3B,UAAU,IAAI,IAAI;IAMlB,UAAU,IAAI,IAAI;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,2 @@
1
+ export * from './axis';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const DEFAULT_LAYER_WIDTH = 200;
2
+ export declare const DEFAULT_LAYER_HEIGHT = 300;
3
+ export declare const HORIZONTAL_AXIS_MARGIN = 40;
4
+ export declare const VERTICAL_AXIS_MARGIN = 30;
5
+ export declare const EXAGGERATED_DIAMETER = 100;
6
+ export declare const HOLE_OUTLINE = 0.6;
7
+ export declare const SCREEN_OUTLINE = 0.3;
8
+ export declare const SHOE_WIDTH = 8;
9
+ export declare const SHOE_LENGTH = 16;
10
+ export declare const DEFAULT_TEXTURE_SIZE = 64;
11
+ export declare const SURFACE_LINE_WIDTH = 1;
12
+ //# sourceMappingURL=constants.d.ts.map
@@ -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"}
@@ -56,3 +56,4 @@ export declare class ExtendedCurveInterpolator extends CurveInterpolator {
56
56
  }): Vector;
57
57
  getPointAt(t: number): Vector;
58
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,SAAO,GAAG,IAAI;IAY9C;;;;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,93 @@
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
+ private _offset;
21
+ displacement: number;
22
+ interpolators: Interpolators;
23
+ startVector: number[];
24
+ endVector: number[];
25
+ _curtainPathCache: MDPoint[] | undefined;
26
+ /**
27
+ * Creates a common reference system that layers and other components can use
28
+ * @param path (required) array of 3d coordinates: [x, y, z]
29
+ * @param options (optional)
30
+ * @param options.trajectoryAngle (optional) - trajectory angle in degrees, overrides the calculated value
31
+ * @param options.calculateDisplacementFromBottom - (optional) specify if the path is passed from bottom up
32
+ */
33
+ constructor(path: number[][], options?: ReferenceSystemOptions);
34
+ private setPath;
35
+ /**
36
+ * Map a length along the curve to intersection coordinates
37
+ * @param length length along the curve
38
+ */
39
+ project(length: number): number[];
40
+ curtainTangent(length: number): number[];
41
+ /**
42
+ * Returns as resampled version of the projected path between start and end
43
+ * Samples are picked from the beginning of the path at every CURTAIN_SAMPLING_INTERVAL meters
44
+ * If the angle between two consecutive segments is close to 180 degrees depending on CURTAIN_SAMPLING_ANGLE_THRESHOLD,
45
+ * a sample in between is discarded.
46
+ *
47
+ * The start and the end are not guaranteed to be part of the returned set of points
48
+ * @param startMd in MD
49
+ * @param endMd in MD
50
+ * @param includeStartEnd guarantee to include the starting and end points
51
+ */
52
+ getCurtainPath(startMd: number, endMd: number, includeStartEnd?: boolean): MDPoint[];
53
+ /**
54
+ * Map a displacement back to length along the curve
55
+ */
56
+ unproject(displacement: number): number | undefined;
57
+ /**
58
+ * Get the normalized displacement [0 - 1] of a specific length along the curve
59
+ */
60
+ getProjectedLength(length: number): number;
61
+ /**
62
+ * Get the trajectory position at a length along the curve
63
+ */
64
+ getPosition(length: number): number[];
65
+ /**
66
+ * Generate a set of coordinates along the trajectory of the curve
67
+ */
68
+ getTrajectory(steps: number, from?: number, to?: number): Trajectory;
69
+ /**
70
+ * Generate a set of coordinates along the trajectory of the curve
71
+ */
72
+ getExtendedTrajectory(numPoints: number, startExtensionLength?: number, endExtensionLength?: number): Trajectory;
73
+ getTrajectoryVector(): number[];
74
+ /**
75
+ * Perform a curtain projection on a set of points in 3D
76
+ * @param points
77
+ * @param origin
78
+ * @param offset
79
+ * @returns {array}
80
+ */
81
+ static toDisplacement(points: number[][], offset?: number): number[][];
82
+ /**
83
+ * returns a normalized vector
84
+ * @param interpolator interpolated curve
85
+ * @param from number between 0 and 1
86
+ * @param to number between 0 and 1
87
+ */
88
+ static getDirectionVector(interpolator: CurveInterpolator, from: number, to: number): number[];
89
+ get length(): number;
90
+ get offset(): number;
91
+ set offset(offset: number);
92
+ }
93
+ //# 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,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAmBxE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,sBAAsB,CAAC,EAAE,yBAAyB,CAAC;IACnD,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,C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;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> | undefined;
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 | undefined;
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,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Q,IAAI,YAAY;IAKxB,QAAQ,IAAI,YAAY;IAKxB,cAAc,IAAI,YAAY;IAK9B,cAAc,IAAI,YAAY;IAK9B,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY;IAajD,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY;IAWvC,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY;IAWvC,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;IASvB,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,IAAI,IAAI,IAAI,IAAI,GAAG,SAAS,CAE3B;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> | undefined;
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 | undefined;
151
+ get zoomPanHandler(): ZoomPanHandler;
152
+ get axis(): Axis | undefined;
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":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,IAAI,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAW,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,gBAAgB,CAA0C;IAElE,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAsB;IAEtC;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,iBAAiB;IActC;;;OAGG;IACH,kBAAkB,CAAC,eAAe,EAAE,2BAA2B,GAAG,UAAU;IAM5E;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,UAAU;IAM1E;;;OAGG;IACH,YAAY,CAAC,sBAAsB,UAAO,GAAG,UAAU;IAKvD;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,UAAU;IAM3E;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;IAKxC;;OAEG;IACH,eAAe,IAAI,UAAU;IAK7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,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,UAAU,CAAC,CAEjC;IAED,IAAI,eAAe,IAAI,2BAA2B,GAAG,SAAS,CAE7D;IAED,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,IAAI,IAAI,IAAI,IAAI,GAAG,SAAS,CAE3B;IAED,IAAI,mBAAmB,IAAI,cAAc,CAExC;CACF"}
@@ -0,0 +1,160 @@
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<HTMLElement, unknown>;
11
+ container: Selection<HTMLElement, unknown, null, undefined>;
12
+ onRescale: RescaleFunction;
13
+ options: ZoomAndPanOptions;
14
+ xBounds: [number, number];
15
+ yBounds: [number, number];
16
+ translateBoundsX: [number, number];
17
+ translateBoundsY: [number, number];
18
+ scaleX: ScaleLinear<number, number>;
19
+ scaleY: ScaleLinear<number, number>;
20
+ _zFactor: number;
21
+ _enableTranslateExtent: boolean;
22
+ currentTransform: ZoomTransform | undefined;
23
+ /**
24
+ * Constructor
25
+ * @param elm, -
26
+ * @param options - options
27
+ */
28
+ constructor(elm: HTMLElement, onRescale: RescaleFunction, options?: ZoomAndPanOptions);
29
+ /**
30
+ * Getter returning width of target
31
+ * @returns width
32
+ */
33
+ get width(): number;
34
+ /**
35
+ * Getter returning height of target
36
+ * @returns height
37
+ */
38
+ get height(): number;
39
+ /**
40
+ * Getter which calculate span from x bounds
41
+ * @returns x span
42
+ */
43
+ get xSpan(): number;
44
+ /**
45
+ * Calculate span from y bounds
46
+ * @returns y span
47
+ */
48
+ get ySpan(): number;
49
+ /**
50
+ * Ratio between height and width
51
+ * @returns ratio
52
+ */
53
+ get viewportRatio(): number;
54
+ /**
55
+ * x ratios screen to value ratio
56
+ * @returns ratio
57
+ */
58
+ get xRatio(): number;
59
+ /**
60
+ * y scale screen to value ratio
61
+ * @returns ratio
62
+ */
63
+ get yRatio(): number;
64
+ /**
65
+ * Get z-factor
66
+ * @returns z-factor
67
+ */
68
+ get zFactor(): number;
69
+ /**
70
+ * Set z factor
71
+ * @param factor
72
+ */
73
+ set zFactor(factor: number);
74
+ /**
75
+ * Check if x is inverted (right to left is positive) from x bounds
76
+ * @returns true if inverted
77
+ */
78
+ get isXInverted(): boolean;
79
+ /**
80
+ * Check if y is inverted (bottom to top is positive) from y bounds
81
+ * @returns true if inverted
82
+ */
83
+ get isYInverted(): boolean;
84
+ /**
85
+ * Get if enable translate extent (pan limit)
86
+ * @returns true if enabled
87
+ */
88
+ get enableTranslateExtent(): boolean;
89
+ /**
90
+ * Set enable translate extent (pan limit)
91
+ * @param enabled - If should be enabled
92
+ */
93
+ set enableTranslateExtent(enabled: boolean);
94
+ /**
95
+ * Update translate extent (pan limits)
96
+ */
97
+ updateTranslateExtent(): void;
98
+ /**
99
+ * Create an event object from current state
100
+ */
101
+ currentStateAsEvent(): OnRescaleEvent;
102
+ /**
103
+ * Update scale
104
+ */
105
+ rescale(): void;
106
+ /**
107
+ * Initialized handler
108
+ */
109
+ init(): void;
110
+ /**
111
+ * Handle zoom
112
+ */
113
+ onZoom(event: {
114
+ transform: ZoomTransform;
115
+ }): void;
116
+ /**
117
+ * Update scale
118
+ */
119
+ applyTransform(transform: ZoomTransform): void;
120
+ /**
121
+ * Set new viewport
122
+ * @param cx - center X pos
123
+ * @param cy - center Y pos
124
+ * @param displ
125
+ * @param duration - duration of transition
126
+ * @returns a merge of filter and payload
127
+ */
128
+ setViewport(cx?: number, cy?: number, displ?: number, duration?: number): void;
129
+ /**
130
+ * Set bounds
131
+ */
132
+ setBounds(xBounds: [number, number], yBounds: [number, number]): void;
133
+ /**
134
+ * Set bounds
135
+ */
136
+ setTranslateBounds(xBounds: [number, number], yBounds: [number, number]): void;
137
+ /**
138
+ * Adjust zoom due to changes in size of target
139
+ * @param force - force update even if size did not change
140
+ */
141
+ adjustToSize(): void;
142
+ adjustToSize(autoAdjust: boolean): void;
143
+ adjustToSize(width: number, height: number, force: boolean): void;
144
+ /**
145
+ * Calculate new transform
146
+ * @param dx0
147
+ * @param dx1
148
+ * @param dy
149
+ * @returns New transformation matrix
150
+ */
151
+ calculateTransform(dx0: number, dx1: number, dy: number): ZoomTransform;
152
+ /**
153
+ * Recalcualate the transform
154
+ */
155
+ recalculateZoomTransform(): void;
156
+ setZoomLevelBoundary(zoomlevels: [number, number]): ZoomPanHandler;
157
+ setMaxZoomLevel(zoomlevel: number): ZoomPanHandler;
158
+ setMinZoomLevel(zoomlevel: number): ZoomPanHandler;
159
+ }
160
+ //# sourceMappingURL=ZoomPanHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomPanHandler.d.ts","sourceRoot":"","sources":["../../src/control/ZoomPanHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAe,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAsB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKlE,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AAC9D;;GAEG;AACH,qBAAa,cAAc;IACzB,IAAI,EAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,SAAS,EAAE,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5D,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAU;IACnC,OAAO,EAAE,CAAC,MAAM,EAAE,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ACH,IAAI,IAAI,IAAI;IAKZ;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,aAAa,CAAA;KAAE,GAAG,IAAI;IAUjD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAuB9C;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAkC9E;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAOrE;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAO9E;;;OAGG;IACH,YAAY,IAAI,IAAI;IACpB,YAAY,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;IACvC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAkCjE;;;;;;OAMG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;IAgBvE;;OAEG;IACH,wBAAwB,IAAI,IAAI;IAehC,oBAAoB,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,cAAc;IAKlE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IAMlD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;CAKnD"}
@@ -0,0 +1,6 @@
1
+ export * from './interfaces';
2
+ export * from './IntersectionReferenceSystem';
3
+ export * from './LayerManager';
4
+ export * from './MainController';
5
+ export * from './ZoomPanHandler';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
2
+ import { ScaleOptions } from '../interfaces';
3
+ import { Layer } from '../layers';
4
+ export interface AxisOptions {
5
+ xLabel: string;
6
+ yLabel: string;
7
+ unitOfMeasure: string;
8
+ }
9
+ export interface ControllerOptions {
10
+ container: HTMLElement;
11
+ axisOptions?: AxisOptions;
12
+ scaleOptions?: ScaleOptions;
13
+ referenceSystem?: IntersectionReferenceSystem;
14
+ layers?: Layer<unknown>[];
15
+ path?: number[][];
16
+ }
17
+ interface OverlayEvent<T> {
18
+ target: Element | undefined;
19
+ source: Element | undefined;
20
+ caller: T;
21
+ }
22
+ export interface OverlayResizeEvent<T> extends OverlayEvent<T> {
23
+ width: number;
24
+ height: number;
25
+ }
26
+ export interface OverlayMouseMoveEvent<T> extends OverlayEvent<T> {
27
+ x: number;
28
+ y: number;
29
+ }
30
+ export type OverlayMouseExitEvent<T> = OverlayEvent<T>;
31
+ export interface OverlayCallbacks<T> {
32
+ onMouseMove?(event: OverlayMouseMoveEvent<T>): void;
33
+ onMouseExit?(event: OverlayMouseExitEvent<T>): void;
34
+ onResize?(event: OverlayResizeEvent<T>): void;
35
+ }
36
+ export {};
37
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/control/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,YAA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