@equinor/videx-map 1.14.3 → 1.14.4
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/dist/EventHandler.d.ts +21 -21
- package/dist/ExplorationLayer.d.ts +38 -38
- package/dist/FaultlineModule.d.ts +51 -51
- package/dist/FieldModule.d.ts +113 -113
- package/dist/GeoJSONModule/GeoJSONModule.d.ts +47 -47
- package/dist/GeoJSONModule/constants.d.ts +13 -13
- package/dist/GeoJSONModule/index.d.ts +6 -6
- package/dist/GeoJSONModule/interfaces.d.ts +15 -15
- package/dist/GeoJSONModule/labels.d.ts +46 -46
- package/dist/GeoJSONModule/linestring.d.ts +55 -55
- package/dist/GeoJSONModule/multipolygon.d.ts +94 -94
- package/dist/GeoJSONModule/point.d.ts +26 -26
- package/dist/GeoJSONModule/polygon.d.ts +96 -96
- package/dist/GeoJSONModule/shader.d.ts +10 -10
- package/dist/ModuleInterface.d.ts +26 -26
- package/dist/OutlineModule.d.ts +81 -81
- package/dist/ResizeConfigInterface.d.ts +14 -14
- package/dist/WellboreModule.d.ts +126 -126
- package/dist/index.d.ts +8 -8
- package/dist/pixiOverlayInterfaces.d.ts +16 -16
- package/dist/utils/ComparableArray.d.ts +60 -60
- package/dist/utils/LineDictionary.d.ts +89 -89
- package/dist/utils/LineInterpolator.d.ts +84 -84
- package/dist/utils/Log.d.ts +1 -1
- package/dist/utils/Mesh.d.ts +46 -46
- package/dist/utils/PointDictionary.d.ts +58 -58
- package/dist/utils/Radius.d.ts +2 -2
- package/dist/utils/Rect.d.ts +27 -27
- package/dist/utils/TriangleDictionary.d.ts +21 -21
- package/dist/utils/WellboreMesh.d.ts +51 -51
- package/dist/utils/centerOfMass.d.ts +8 -8
- package/dist/utils/fields/Highlighter.d.ts +33 -33
- package/dist/utils/fields/LabelManager.d.ts +62 -62
- package/dist/utils/fields/groupLabels.d.ts +5 -5
- package/dist/utils/fields/preprocessFields.d.ts +29 -29
- package/dist/utils/generateCircle.d.ts +10 -10
- package/dist/utils/linePoint.d.ts +27 -27
- package/dist/utils/lineReducer.d.ts +9 -9
- package/dist/utils/wellbores/AsyncLoop.d.ts +35 -35
- package/dist/utils/wellbores/Colors.d.ts +40 -40
- package/dist/utils/wellbores/Config.d.ts +80 -80
- package/dist/utils/wellbores/DataManager.d.ts +15 -15
- package/dist/utils/wellbores/Highlight.d.ts +18 -18
- package/dist/utils/wellbores/LabelType.d.ts +9 -9
- package/dist/utils/wellbores/Projector.d.ts +20 -20
- package/dist/utils/wellbores/RealtimeWellbore.d.ts +21 -21
- package/dist/utils/wellbores/Shader.d.ts +41 -41
- package/dist/utils/wellbores/data/Group.d.ts +48 -48
- package/dist/utils/wellbores/data/RootData.d.ts +29 -29
- package/dist/utils/wellbores/data/SourceData.d.ts +25 -25
- package/dist/utils/wellbores/data/WellboreData.d.ts +76 -76
- package/dist/utils/wellbores/data/WellboreEventData.d.ts +16 -16
- package/dist/utils/wellbores/data/details/Detail.d.ts +20 -20
- package/dist/utils/wellbores/data/details/DetailOptions.d.ts +7 -7
- package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +14 -14
- package/dist/utils/wellbores/data/details/index.d.ts +11 -11
- package/dist/utils/wellbores/data/index.d.ts +6 -6
- package/dist/utils/wellbores/highlight-helper.d.ts +6 -6
- package/dist/utils/wellbores/intervals.d.ts +15 -15
- package/dist/utils/wellbores/labels/Label.d.ts +39 -39
- package/dist/utils/wellbores/labels/index.d.ts +2 -2
- package/dist/utils/wellbores/labels/label-helper.d.ts +3 -3
- package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -23
- package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -22
- package/dist/utils/wellbores/registries/index.d.ts +2 -2
- package/package.json +12 -9
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
/** Interface of a single point. */
|
|
3
|
-
interface Point<T> {
|
|
4
|
-
/** Value stored in point. */
|
|
5
|
-
val: T;
|
|
6
|
-
/** Position of points. */
|
|
7
|
-
pos: Vector2;
|
|
8
|
-
/** ID of point. */
|
|
9
|
-
id: number;
|
|
10
|
-
}
|
|
11
|
-
/** Dictionary for points. Also manages overlapping. */
|
|
12
|
-
export default class PointDictionary<T> {
|
|
13
|
-
/** Threshold to define overlapping. */
|
|
14
|
-
distThreshold: number;
|
|
15
|
-
/** gridSize of data segmentation. */
|
|
16
|
-
gridSize: number;
|
|
17
|
-
/** Radius of points. */
|
|
18
|
-
radius: number;
|
|
19
|
-
/** Mapping tile coordinates, on format 'x.y', to submap of points. */
|
|
20
|
-
tiles: Map<string, Map<number, Point<T>>>;
|
|
21
|
-
/** Mapping point IDs to values. */
|
|
22
|
-
pointValues: Map<number, Point<T>>;
|
|
23
|
-
/** User provided function to test if a line is active or not */
|
|
24
|
-
testActiveFunction: (value: T) => boolean;
|
|
25
|
-
/** Used to assign PointID */
|
|
26
|
-
private pointSeq;
|
|
27
|
-
/**
|
|
28
|
-
* Constructs a new point dictionary.
|
|
29
|
-
* @param distThreshold Threshold for what is considered overlapping
|
|
30
|
-
* @param gridSize grid cell size used for segmentation
|
|
31
|
-
*/
|
|
32
|
-
constructor(distThreshold: number, gridSize: number, radius: number, testActive?: (value: T) => boolean);
|
|
33
|
-
/**
|
|
34
|
-
* Add a single point to the dictionary.
|
|
35
|
-
* @param pos Position of point
|
|
36
|
-
* @param val Value stored within points
|
|
37
|
-
* @returns ID of newly added point
|
|
38
|
-
*/
|
|
39
|
-
add(pos: Vector2, val: T): number;
|
|
40
|
-
private getKeys;
|
|
41
|
-
isActive(point: Point<T>): boolean;
|
|
42
|
-
getKey(position: Vector2): string;
|
|
43
|
-
/**
|
|
44
|
-
* Get overlapping points, if any.
|
|
45
|
-
* @param pos Target position
|
|
46
|
-
* @returns Overlapping point
|
|
47
|
-
*/
|
|
48
|
-
getOverlapping(pos: Vector2): Point<T>;
|
|
49
|
-
/**
|
|
50
|
-
* Get closest point under coordinates defined by radius.
|
|
51
|
-
* @param pos Target position
|
|
52
|
-
* @returns Closest point
|
|
53
|
-
*/
|
|
54
|
-
getClosestUnder(pos: Vector2, radius?: number): Point<T>;
|
|
55
|
-
/** Clear point dictionary to prepare for new data. */
|
|
56
|
-
clear(filter?: (value: T, id: number) => boolean): void;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
/** Interface of a single point. */
|
|
3
|
+
interface Point<T> {
|
|
4
|
+
/** Value stored in point. */
|
|
5
|
+
val: T;
|
|
6
|
+
/** Position of points. */
|
|
7
|
+
pos: Vector2;
|
|
8
|
+
/** ID of point. */
|
|
9
|
+
id: number;
|
|
10
|
+
}
|
|
11
|
+
/** Dictionary for points. Also manages overlapping. */
|
|
12
|
+
export default class PointDictionary<T> {
|
|
13
|
+
/** Threshold to define overlapping. */
|
|
14
|
+
distThreshold: number;
|
|
15
|
+
/** gridSize of data segmentation. */
|
|
16
|
+
gridSize: number;
|
|
17
|
+
/** Radius of points. */
|
|
18
|
+
radius: number;
|
|
19
|
+
/** Mapping tile coordinates, on format 'x.y', to submap of points. */
|
|
20
|
+
tiles: Map<string, Map<number, Point<T>>>;
|
|
21
|
+
/** Mapping point IDs to values. */
|
|
22
|
+
pointValues: Map<number, Point<T>>;
|
|
23
|
+
/** User provided function to test if a line is active or not */
|
|
24
|
+
testActiveFunction: (value: T) => boolean;
|
|
25
|
+
/** Used to assign PointID */
|
|
26
|
+
private pointSeq;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a new point dictionary.
|
|
29
|
+
* @param distThreshold Threshold for what is considered overlapping
|
|
30
|
+
* @param gridSize grid cell size used for segmentation
|
|
31
|
+
*/
|
|
32
|
+
constructor(distThreshold: number, gridSize: number, radius: number, testActive?: (value: T) => boolean);
|
|
33
|
+
/**
|
|
34
|
+
* Add a single point to the dictionary.
|
|
35
|
+
* @param pos Position of point
|
|
36
|
+
* @param val Value stored within points
|
|
37
|
+
* @returns ID of newly added point
|
|
38
|
+
*/
|
|
39
|
+
add(pos: Vector2, val: T): number;
|
|
40
|
+
private getKeys;
|
|
41
|
+
isActive(point: Point<T>): boolean;
|
|
42
|
+
getKey(position: Vector2): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get overlapping points, if any.
|
|
45
|
+
* @param pos Target position
|
|
46
|
+
* @returns Overlapping point
|
|
47
|
+
*/
|
|
48
|
+
getOverlapping(pos: Vector2): Point<T>;
|
|
49
|
+
/**
|
|
50
|
+
* Get closest point under coordinates defined by radius.
|
|
51
|
+
* @param pos Target position
|
|
52
|
+
* @returns Closest point
|
|
53
|
+
*/
|
|
54
|
+
getClosestUnder(pos: Vector2, radius?: number): Point<T>;
|
|
55
|
+
/** Clear point dictionary to prepare for new data. */
|
|
56
|
+
clear(filter?: (value: T, id: number) => boolean): void;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
package/dist/utils/Radius.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ResizeConfig } from '../ResizeConfigInterface';
|
|
2
|
-
export declare function getRadius(zoom: number, { min, max }: ResizeConfig): number;
|
|
1
|
+
import { ResizeConfig } from '../ResizeConfigInterface';
|
|
2
|
+
export declare function getRadius(zoom: number, { min, max }: ResizeConfig): number;
|
package/dist/utils/Rect.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
import { VectorLike } from '@equinor/videx-linear-algebra';
|
|
3
|
-
export default class Rect {
|
|
4
|
-
lowerLeft: Vector2;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
rotation: number;
|
|
8
|
-
constructor(lowerLeft: Vector2, width: number, height: number, rotation: number);
|
|
9
|
-
/**
|
|
10
|
-
* Check if a point is inside.
|
|
11
|
-
* @param vector Vector to evaluate
|
|
12
|
-
* @returns True if point is inside rectangle
|
|
13
|
-
*/
|
|
14
|
-
isInside(vector: VectorLike): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Check if a point is inside.
|
|
17
|
-
* @param x X position to evaluate
|
|
18
|
-
* @param y Y position to evaluate
|
|
19
|
-
* @returns True if point is inside rectangle
|
|
20
|
-
*/
|
|
21
|
-
isInside(x: number, y: number): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Transforms position from world space to local space.
|
|
24
|
-
* @param position
|
|
25
|
-
*/
|
|
26
|
-
inverseTransformPoint(x: number, y: number): Vector2;
|
|
27
|
-
}
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
import { VectorLike } from '@equinor/videx-linear-algebra';
|
|
3
|
+
export default class Rect {
|
|
4
|
+
lowerLeft: Vector2;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
rotation: number;
|
|
8
|
+
constructor(lowerLeft: Vector2, width: number, height: number, rotation: number);
|
|
9
|
+
/**
|
|
10
|
+
* Check if a point is inside.
|
|
11
|
+
* @param vector Vector to evaluate
|
|
12
|
+
* @returns True if point is inside rectangle
|
|
13
|
+
*/
|
|
14
|
+
isInside(vector: VectorLike): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a point is inside.
|
|
17
|
+
* @param x X position to evaluate
|
|
18
|
+
* @param y Y position to evaluate
|
|
19
|
+
* @returns True if point is inside rectangle
|
|
20
|
+
*/
|
|
21
|
+
isInside(x: number, y: number): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Transforms position from world space to local space.
|
|
24
|
+
* @param position
|
|
25
|
+
*/
|
|
26
|
+
inverseTransformPoint(x: number, y: number): Vector2;
|
|
27
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
type vec2 = [number, number];
|
|
2
|
-
interface Triangle {
|
|
3
|
-
v1: vec2;
|
|
4
|
-
v2: vec2;
|
|
5
|
-
v3: vec2;
|
|
6
|
-
polygonID: number;
|
|
7
|
-
}
|
|
8
|
-
export default class TriangleDictionary<T> {
|
|
9
|
-
/** Resolution of data segmentation. */
|
|
10
|
-
resolution: number;
|
|
11
|
-
/** Map with collection of triangle IDs. */
|
|
12
|
-
tiles: Map<string, number[]>;
|
|
13
|
-
/** Triangle IDs to polygon. */
|
|
14
|
-
triangles: Triangle[];
|
|
15
|
-
/** Mapping polygon IDs to values. */
|
|
16
|
-
polygonValues: T[];
|
|
17
|
-
constructor(decimals?: number);
|
|
18
|
-
add(vertices: vec2[], triangles: number[], value: T): void;
|
|
19
|
-
getPolygonAt(target: vec2): T;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
type vec2 = [number, number];
|
|
2
|
+
interface Triangle {
|
|
3
|
+
v1: vec2;
|
|
4
|
+
v2: vec2;
|
|
5
|
+
v3: vec2;
|
|
6
|
+
polygonID: number;
|
|
7
|
+
}
|
|
8
|
+
export default class TriangleDictionary<T> {
|
|
9
|
+
/** Resolution of data segmentation. */
|
|
10
|
+
resolution: number;
|
|
11
|
+
/** Map with collection of triangle IDs. */
|
|
12
|
+
tiles: Map<string, number[]>;
|
|
13
|
+
/** Triangle IDs to polygon. */
|
|
14
|
+
triangles: Triangle[];
|
|
15
|
+
/** Mapping polygon IDs to values. */
|
|
16
|
+
polygonValues: T[];
|
|
17
|
+
constructor(decimals?: number);
|
|
18
|
+
add(vertices: vec2[], triangles: number[], value: T): void;
|
|
19
|
+
getPolygonAt(target: vec2): T;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { SegmentPoint, LineInterpolator } from './LineInterpolator';
|
|
2
|
-
import { TickConfig } from './wellbores/Config';
|
|
3
|
-
interface meshData {
|
|
4
|
-
vertices: number[];
|
|
5
|
-
triangles: number[];
|
|
6
|
-
vertexData: number[];
|
|
7
|
-
extraData: number[];
|
|
8
|
-
}
|
|
9
|
-
export declare class WellboreMesh {
|
|
10
|
-
/** Line interpolator used to construct mesh. */
|
|
11
|
-
interp: LineInterpolator;
|
|
12
|
-
/** Thickness of line. */
|
|
13
|
-
thickness: number;
|
|
14
|
-
/** Index of latest vertex, i.e. base for triangulation of new geometry. */
|
|
15
|
-
baseTris: number;
|
|
16
|
-
/** Width and height of tick. */
|
|
17
|
-
tick: TickConfig;
|
|
18
|
-
/**
|
|
19
|
-
* Constructor for creating a new line interpolator.
|
|
20
|
-
* @param interp Interpolator used to generate line
|
|
21
|
-
*/
|
|
22
|
-
constructor(interp: LineInterpolator, thickness: number, tick: TickConfig);
|
|
23
|
-
/**
|
|
24
|
-
* Generate mesh. Interval positioning should be relative.
|
|
25
|
-
* @param intervals Collection of intervals on the format: [ [Start0, End0], ..., [StartN, EndN] ]
|
|
26
|
-
*/
|
|
27
|
-
generate(intervals?: [number, number][]): meshData;
|
|
28
|
-
/**
|
|
29
|
-
* Append line segment from a section of points.
|
|
30
|
-
* @param section Collection of segment points
|
|
31
|
-
* @param type Type of segment, applied as vertex color
|
|
32
|
-
* @param vertices 1-dimensional array with vertices
|
|
33
|
-
* @param triangles 1-dimensional array with triangulation
|
|
34
|
-
* @param vertexData 1-dimensional array with vertex data
|
|
35
|
-
* @param extraData 1-dimensional array with type-data
|
|
36
|
-
* @private
|
|
37
|
-
*/
|
|
38
|
-
appendSegment(section: SegmentPoint[], type: number, vertices: number[], triangles: number[], vertexData: number[], extraData: number[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Creates a tick at the given position.
|
|
41
|
-
* @param p Position of tick
|
|
42
|
-
* @param baseTris Base triangle index
|
|
43
|
-
* @param vertices 1-dimensional array with vertices
|
|
44
|
-
* @param triangles 1-dimensional array with triangulation
|
|
45
|
-
* @param vertexData 1-dimensional array with vertex data
|
|
46
|
-
* @param extraData 1-dimensional array with type-data
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
private generateCrossline;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
1
|
+
import { SegmentPoint, LineInterpolator } from './LineInterpolator';
|
|
2
|
+
import { TickConfig } from './wellbores/Config';
|
|
3
|
+
interface meshData {
|
|
4
|
+
vertices: number[];
|
|
5
|
+
triangles: number[];
|
|
6
|
+
vertexData: number[];
|
|
7
|
+
extraData: number[];
|
|
8
|
+
}
|
|
9
|
+
export declare class WellboreMesh {
|
|
10
|
+
/** Line interpolator used to construct mesh. */
|
|
11
|
+
interp: LineInterpolator;
|
|
12
|
+
/** Thickness of line. */
|
|
13
|
+
thickness: number;
|
|
14
|
+
/** Index of latest vertex, i.e. base for triangulation of new geometry. */
|
|
15
|
+
baseTris: number;
|
|
16
|
+
/** Width and height of tick. */
|
|
17
|
+
tick: TickConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for creating a new line interpolator.
|
|
20
|
+
* @param interp Interpolator used to generate line
|
|
21
|
+
*/
|
|
22
|
+
constructor(interp: LineInterpolator, thickness: number, tick: TickConfig);
|
|
23
|
+
/**
|
|
24
|
+
* Generate mesh. Interval positioning should be relative.
|
|
25
|
+
* @param intervals Collection of intervals on the format: [ [Start0, End0], ..., [StartN, EndN] ]
|
|
26
|
+
*/
|
|
27
|
+
generate(intervals?: [number, number][]): meshData;
|
|
28
|
+
/**
|
|
29
|
+
* Append line segment from a section of points.
|
|
30
|
+
* @param section Collection of segment points
|
|
31
|
+
* @param type Type of segment, applied as vertex color
|
|
32
|
+
* @param vertices 1-dimensional array with vertices
|
|
33
|
+
* @param triangles 1-dimensional array with triangulation
|
|
34
|
+
* @param vertexData 1-dimensional array with vertex data
|
|
35
|
+
* @param extraData 1-dimensional array with type-data
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
appendSegment(section: SegmentPoint[], type: number, vertices: number[], triangles: number[], vertexData: number[], extraData: number[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a tick at the given position.
|
|
41
|
+
* @param p Position of tick
|
|
42
|
+
* @param baseTris Base triangle index
|
|
43
|
+
* @param vertices 1-dimensional array with vertices
|
|
44
|
+
* @param triangles 1-dimensional array with triangulation
|
|
45
|
+
* @param vertexData 1-dimensional array with vertex data
|
|
46
|
+
* @param extraData 1-dimensional array with type-data
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
private generateCrossline;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
/**
|
|
3
|
-
* Get the center of mass of a polygon.
|
|
4
|
-
* @param vertices Vertices of polygon
|
|
5
|
-
* @param triangles Triangles of polygon
|
|
6
|
-
* @returns Center of mass and mass of polygon
|
|
7
|
-
*/
|
|
8
|
-
export default function centerOfMass(vertices: Vector2[], triangles: number[]): [Vector2, number];
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
/**
|
|
3
|
+
* Get the center of mass of a polygon.
|
|
4
|
+
* @param vertices Vertices of polygon
|
|
5
|
+
* @param triangles Triangles of polygon
|
|
6
|
+
* @returns Center of mass and mass of polygon
|
|
7
|
+
*/
|
|
8
|
+
export default function centerOfMass(vertices: Vector2[], triangles: number[]): [Vector2, number];
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { FieldMesh } from '../../FieldModule';
|
|
2
|
-
type vec3 = [number, number, number];
|
|
3
|
-
interface Cache {
|
|
4
|
-
fillCol1: vec3;
|
|
5
|
-
fillCol2: vec3;
|
|
6
|
-
outlineCol: vec3;
|
|
7
|
-
baseZIndex: number;
|
|
8
|
-
field: FieldMesh;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Highlighter class for field layer.
|
|
12
|
-
*/
|
|
13
|
-
export default class Hightlighter {
|
|
14
|
-
fields: FieldMesh[][];
|
|
15
|
-
cached: Cache[];
|
|
16
|
-
fillColor1: vec3;
|
|
17
|
-
fillColor2: vec3;
|
|
18
|
-
outlineColor: vec3;
|
|
19
|
-
constructor(fillColor1: vec3, fillColor2: vec3, outlineColor: vec3);
|
|
20
|
-
/**
|
|
21
|
-
* Add a new group to highlighter.
|
|
22
|
-
* @param group Group of field meshes
|
|
23
|
-
*/
|
|
24
|
-
add(group: FieldMesh[]): void;
|
|
25
|
-
/**
|
|
26
|
-
* Highlight a group by given index.
|
|
27
|
-
* @param index Index of group to highlight
|
|
28
|
-
*/
|
|
29
|
-
highlight(index: number): void;
|
|
30
|
-
/** Revert any highlighting. */
|
|
31
|
-
revert(): boolean;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
1
|
+
import { FieldMesh } from '../../FieldModule';
|
|
2
|
+
type vec3 = [number, number, number];
|
|
3
|
+
interface Cache {
|
|
4
|
+
fillCol1: vec3;
|
|
5
|
+
fillCol2: vec3;
|
|
6
|
+
outlineCol: vec3;
|
|
7
|
+
baseZIndex: number;
|
|
8
|
+
field: FieldMesh;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Highlighter class for field layer.
|
|
12
|
+
*/
|
|
13
|
+
export default class Hightlighter {
|
|
14
|
+
fields: FieldMesh[][];
|
|
15
|
+
cached: Cache[];
|
|
16
|
+
fillColor1: vec3;
|
|
17
|
+
fillColor2: vec3;
|
|
18
|
+
outlineColor: vec3;
|
|
19
|
+
constructor(fillColor1: vec3, fillColor2: vec3, outlineColor: vec3);
|
|
20
|
+
/**
|
|
21
|
+
* Add a new group to highlighter.
|
|
22
|
+
* @param group Group of field meshes
|
|
23
|
+
*/
|
|
24
|
+
add(group: FieldMesh[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Highlight a group by given index.
|
|
27
|
+
* @param index Index of group to highlight
|
|
28
|
+
*/
|
|
29
|
+
highlight(index: number): void;
|
|
30
|
+
/** Revert any highlighting. */
|
|
31
|
+
revert(): boolean;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
/** Data for label. */
|
|
4
|
-
export type LabelData = {
|
|
5
|
-
position: Vector2;
|
|
6
|
-
mass: number;
|
|
7
|
-
};
|
|
8
|
-
/** Field with connected labels. */
|
|
9
|
-
interface Field {
|
|
10
|
-
name: string;
|
|
11
|
-
position: Vector2;
|
|
12
|
-
instance?: PIXI.Text;
|
|
13
|
-
}
|
|
14
|
-
/** Instance of a multi-label entry. */
|
|
15
|
-
export type Label = {
|
|
16
|
-
position: Vector2;
|
|
17
|
-
mass: number;
|
|
18
|
-
instance: PIXI.Text;
|
|
19
|
-
active: boolean;
|
|
20
|
-
};
|
|
21
|
-
export interface MultiField {
|
|
22
|
-
name: string;
|
|
23
|
-
labels: Label[];
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
}
|
|
27
|
-
/** Class used to manage field labels. Handles scaling and grouping of labels. */
|
|
28
|
-
export default class LabelManager {
|
|
29
|
-
/** The textstyle used for labels. */
|
|
30
|
-
textStyle: PIXI.TextStyle;
|
|
31
|
-
/** Scale of labels when size is set to 1. */
|
|
32
|
-
baseScale: number;
|
|
33
|
-
/** Collection of single-polygon fields. */
|
|
34
|
-
fields: Field[];
|
|
35
|
-
/** Collectionh of multi-polygon fields. Labels are grouped when scaling. */
|
|
36
|
-
multiFields: MultiField[];
|
|
37
|
-
/** Value of previous scale */
|
|
38
|
-
prevScale: number;
|
|
39
|
-
/** Visibility of labels */
|
|
40
|
-
visible: boolean;
|
|
41
|
-
/** construct a new label manager. */
|
|
42
|
-
constructor(textStyle: PIXI.TextStyle, baseScale: number);
|
|
43
|
-
/**
|
|
44
|
-
* Add a new field to manage.
|
|
45
|
-
* @param name Name of field
|
|
46
|
-
* @param entries Data for each label
|
|
47
|
-
*/
|
|
48
|
-
addField(name: string, entries: LabelData[]): void;
|
|
49
|
-
/**
|
|
50
|
-
* Draw all labels assigned to manager.
|
|
51
|
-
* @param root Target root for labels
|
|
52
|
-
*/
|
|
53
|
-
draw(root: PIXI.Container): void;
|
|
54
|
-
/**
|
|
55
|
-
* Resize all labels.
|
|
56
|
-
* @param scale New scale for labels
|
|
57
|
-
*/
|
|
58
|
-
resize(scale: number): void;
|
|
59
|
-
hideLabels(): void;
|
|
60
|
-
showLabels(): void;
|
|
61
|
-
}
|
|
62
|
-
export {};
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
+
/** Data for label. */
|
|
4
|
+
export type LabelData = {
|
|
5
|
+
position: Vector2;
|
|
6
|
+
mass: number;
|
|
7
|
+
};
|
|
8
|
+
/** Field with connected labels. */
|
|
9
|
+
interface Field {
|
|
10
|
+
name: string;
|
|
11
|
+
position: Vector2;
|
|
12
|
+
instance?: PIXI.Text;
|
|
13
|
+
}
|
|
14
|
+
/** Instance of a multi-label entry. */
|
|
15
|
+
export type Label = {
|
|
16
|
+
position: Vector2;
|
|
17
|
+
mass: number;
|
|
18
|
+
instance: PIXI.Text;
|
|
19
|
+
active: boolean;
|
|
20
|
+
};
|
|
21
|
+
export interface MultiField {
|
|
22
|
+
name: string;
|
|
23
|
+
labels: Label[];
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
/** Class used to manage field labels. Handles scaling and grouping of labels. */
|
|
28
|
+
export default class LabelManager {
|
|
29
|
+
/** The textstyle used for labels. */
|
|
30
|
+
textStyle: PIXI.TextStyle;
|
|
31
|
+
/** Scale of labels when size is set to 1. */
|
|
32
|
+
baseScale: number;
|
|
33
|
+
/** Collection of single-polygon fields. */
|
|
34
|
+
fields: Field[];
|
|
35
|
+
/** Collectionh of multi-polygon fields. Labels are grouped when scaling. */
|
|
36
|
+
multiFields: MultiField[];
|
|
37
|
+
/** Value of previous scale */
|
|
38
|
+
prevScale: number;
|
|
39
|
+
/** Visibility of labels */
|
|
40
|
+
visible: boolean;
|
|
41
|
+
/** construct a new label manager. */
|
|
42
|
+
constructor(textStyle: PIXI.TextStyle, baseScale: number);
|
|
43
|
+
/**
|
|
44
|
+
* Add a new field to manage.
|
|
45
|
+
* @param name Name of field
|
|
46
|
+
* @param entries Data for each label
|
|
47
|
+
*/
|
|
48
|
+
addField(name: string, entries: LabelData[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Draw all labels assigned to manager.
|
|
51
|
+
* @param root Target root for labels
|
|
52
|
+
*/
|
|
53
|
+
draw(root: PIXI.Container): void;
|
|
54
|
+
/**
|
|
55
|
+
* Resize all labels.
|
|
56
|
+
* @param scale New scale for labels
|
|
57
|
+
*/
|
|
58
|
+
resize(scale: number): void;
|
|
59
|
+
hideLabels(): void;
|
|
60
|
+
showLabels(): void;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MultiField } from './LabelManager';
|
|
2
|
-
/**
|
|
3
|
-
* Function for grouping labels.
|
|
4
|
-
*/
|
|
5
|
-
export default function groupLabels(field: MultiField, scale: number): [number, number][];
|
|
1
|
+
import { MultiField } from './LabelManager';
|
|
2
|
+
/**
|
|
3
|
+
* Function for grouping labels.
|
|
4
|
+
*/
|
|
5
|
+
export default function groupLabels(field: MultiField, scale: number): [number, number][];
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Field } from '../../FieldModule';
|
|
2
|
-
/** Interface for data within a processed field. */
|
|
3
|
-
export interface PreprocessedField {
|
|
4
|
-
type: string;
|
|
5
|
-
geometry: [
|
|
6
|
-
{
|
|
7
|
-
coordinates: [number, number][];
|
|
8
|
-
properties: {
|
|
9
|
-
discname: string;
|
|
10
|
-
hctype: string;
|
|
11
|
-
polygonId: number;
|
|
12
|
-
status: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
];
|
|
16
|
-
properties: {
|
|
17
|
-
group: number;
|
|
18
|
-
guid?: number;
|
|
19
|
-
label: string;
|
|
20
|
-
lat: number;
|
|
21
|
-
long: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Preprocess field data to a more managable format.
|
|
26
|
-
* @param data Data to process
|
|
27
|
-
* @returns Processed data
|
|
28
|
-
*/
|
|
29
|
-
export default function preprocessFields(data: Field[]): PreprocessedField[];
|
|
1
|
+
import { Field } from '../../FieldModule';
|
|
2
|
+
/** Interface for data within a processed field. */
|
|
3
|
+
export interface PreprocessedField {
|
|
4
|
+
type: string;
|
|
5
|
+
geometry: [
|
|
6
|
+
{
|
|
7
|
+
coordinates: [number, number][];
|
|
8
|
+
properties: {
|
|
9
|
+
discname: string;
|
|
10
|
+
hctype: string;
|
|
11
|
+
polygonId: number;
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
properties: {
|
|
17
|
+
group: number;
|
|
18
|
+
guid?: number;
|
|
19
|
+
label: string;
|
|
20
|
+
lat: number;
|
|
21
|
+
long: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Preprocess field data to a more managable format.
|
|
26
|
+
* @param data Data to process
|
|
27
|
+
* @returns Processed data
|
|
28
|
+
*/
|
|
29
|
+
export default function preprocessFields(data: Field[]): PreprocessedField[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
-
import * as PIXI from 'pixi.js';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param center
|
|
6
|
-
* @param radius
|
|
7
|
-
* @param uniformRadius Fraction of full radius used by uniform initially
|
|
8
|
-
* @return New circle mesh with shader uniforms attached
|
|
9
|
-
*/
|
|
10
|
-
export default function generateCircle(center: Vector2, radius: number, shader: any): PIXI.Mesh;
|
|
1
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
|
+
import * as PIXI from 'pixi.js';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param center
|
|
6
|
+
* @param radius
|
|
7
|
+
* @param uniformRadius Fraction of full radius used by uniform initially
|
|
8
|
+
* @return New circle mesh with shader uniforms attached
|
|
9
|
+
*/
|
|
10
|
+
export default function generateCircle(center: Vector2, radius: number, shader: any): PIXI.Mesh;
|