@equinor/videx-map 1.14.7 → 1.14.9
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 +1 -0
- package/package.json +5 -11
- package/dist/EventHandler.d.ts +0 -21
- package/dist/ExplorationLayer.d.ts +0 -38
- package/dist/FaultlineModule.d.ts +0 -51
- package/dist/FieldModule.d.ts +0 -113
- package/dist/GeoJSONModule/GeoJSONModule.d.ts +0 -47
- package/dist/GeoJSONModule/constants.d.ts +0 -13
- package/dist/GeoJSONModule/index.d.ts +0 -6
- package/dist/GeoJSONModule/interfaces.d.ts +0 -15
- package/dist/GeoJSONModule/labels.d.ts +0 -46
- package/dist/GeoJSONModule/linestring.d.ts +0 -55
- package/dist/GeoJSONModule/multipolygon.d.ts +0 -94
- package/dist/GeoJSONModule/point.d.ts +0 -26
- package/dist/GeoJSONModule/polygon.d.ts +0 -96
- package/dist/GeoJSONModule/shader.d.ts +0 -10
- package/dist/ModuleInterface.d.ts +0 -26
- package/dist/OutlineModule.d.ts +0 -81
- package/dist/ResizeConfigInterface.d.ts +0 -14
- package/dist/WellboreModule.d.ts +0 -126
- package/dist/index.d.ts +0 -8
- package/dist/index.esm.js +0 -1
- package/dist/index.js +0 -1
- package/dist/index.umd.js +0 -1
- package/dist/pixiOverlayInterfaces.d.ts +0 -16
- package/dist/utils/ComparableArray.d.ts +0 -60
- package/dist/utils/LineDictionary.d.ts +0 -89
- package/dist/utils/LineInterpolator.d.ts +0 -84
- package/dist/utils/Log.d.ts +0 -1
- package/dist/utils/Mesh.d.ts +0 -46
- package/dist/utils/PointDictionary.d.ts +0 -58
- package/dist/utils/Radius.d.ts +0 -2
- package/dist/utils/Rect.d.ts +0 -27
- package/dist/utils/TriangleDictionary.d.ts +0 -21
- package/dist/utils/WellboreMesh.d.ts +0 -51
- package/dist/utils/centerOfMass.d.ts +0 -8
- package/dist/utils/fields/Highlighter.d.ts +0 -33
- package/dist/utils/fields/LabelManager.d.ts +0 -62
- package/dist/utils/fields/groupLabels.d.ts +0 -5
- package/dist/utils/fields/preprocessFields.d.ts +0 -29
- package/dist/utils/generateCircle.d.ts +0 -10
- package/dist/utils/linePoint.d.ts +0 -27
- package/dist/utils/lineReducer.d.ts +0 -9
- package/dist/utils/wellbores/AsyncLoop.d.ts +0 -35
- package/dist/utils/wellbores/Colors.d.ts +0 -40
- package/dist/utils/wellbores/Config.d.ts +0 -80
- package/dist/utils/wellbores/DataManager.d.ts +0 -15
- package/dist/utils/wellbores/Highlight.d.ts +0 -18
- package/dist/utils/wellbores/LabelType.d.ts +0 -9
- package/dist/utils/wellbores/Projector.d.ts +0 -20
- package/dist/utils/wellbores/RealtimeWellbore.d.ts +0 -21
- package/dist/utils/wellbores/Shader.d.ts +0 -41
- package/dist/utils/wellbores/data/Group.d.ts +0 -48
- package/dist/utils/wellbores/data/RootData.d.ts +0 -29
- package/dist/utils/wellbores/data/SourceData.d.ts +0 -25
- package/dist/utils/wellbores/data/WellboreData.d.ts +0 -76
- package/dist/utils/wellbores/data/WellboreEventData.d.ts +0 -16
- package/dist/utils/wellbores/data/details/Detail.d.ts +0 -20
- package/dist/utils/wellbores/data/details/DetailOptions.d.ts +0 -7
- package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +0 -14
- package/dist/utils/wellbores/data/details/index.d.ts +0 -11
- package/dist/utils/wellbores/data/index.d.ts +0 -6
- package/dist/utils/wellbores/highlight-helper.d.ts +0 -6
- package/dist/utils/wellbores/intervals.d.ts +0 -15
- package/dist/utils/wellbores/labels/Label.d.ts +0 -39
- package/dist/utils/wellbores/labels/index.d.ts +0 -2
- package/dist/utils/wellbores/labels/label-helper.d.ts +0 -3
- package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +0 -23
- package/dist/utils/wellbores/registries/ColorRegistry.d.ts +0 -22
- package/dist/utils/wellbores/registries/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
[](https://badge.fury.io/js/%40equinor%2Fvidex-map)
|
|
2
2
|

|
|
3
|
+
[](https://scm-compliance-api.radix.equinor.com/repos/equinor/videx-map/badge)
|
|
3
4
|
|
|
4
5
|
# Videx map
|
|
5
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/videx-map",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.9",
|
|
4
4
|
"description": "Component for Pixi-overlay in Leaflet.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
"test": "jest",
|
|
19
19
|
"test:watch": "jest --watchAll",
|
|
20
20
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx src --color",
|
|
21
|
-
"lint:ci": "eslint --ext .js,.jsx,.ts,.tsx src --color --format table --quiet",
|
|
22
21
|
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --fix",
|
|
23
22
|
"predocs": "rimraf docs",
|
|
24
23
|
"docs": "typedoc --out docs src",
|
|
25
|
-
"postdocs": "
|
|
24
|
+
"postdocs": "node postdocs.copyfiles.mjs",
|
|
26
25
|
"lint-staged": "lint-staged",
|
|
27
26
|
"prepare": "husky install"
|
|
28
27
|
},
|
|
@@ -50,9 +49,7 @@
|
|
|
50
49
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
51
50
|
"@rollup/plugin-terser": "^0.4.4",
|
|
52
51
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
53
|
-
"@storybook/html": "^8.2.9",
|
|
54
52
|
"@storybook/html-webpack5": "^8.2.9",
|
|
55
|
-
"@types/babel__core": "^7.20.5",
|
|
56
53
|
"@types/d3-color": "^3.1.3",
|
|
57
54
|
"@types/d3-scale-chromatic": "^3.0.3",
|
|
58
55
|
"@types/d3-selection": "^3.0.10",
|
|
@@ -63,9 +60,6 @@
|
|
|
63
60
|
"@types/uuid": "^8.3.0",
|
|
64
61
|
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
65
62
|
"@typescript-eslint/parser": "^6.16.0",
|
|
66
|
-
"babel-loader": "^9.1.3",
|
|
67
|
-
"copyfiles": "^2.3.0",
|
|
68
|
-
"eslint-formatter-table": "^7.32.1",
|
|
69
63
|
"eslint-plugin-storybook": "^0.6.15",
|
|
70
64
|
"husky": "^8.0.3",
|
|
71
65
|
"jest": "^29.7.0",
|
|
@@ -82,7 +76,7 @@
|
|
|
82
76
|
"ts-loader": "^9.5.1",
|
|
83
77
|
"ts-node": "^10.8.1",
|
|
84
78
|
"tslib": "^2.6.1",
|
|
85
|
-
"typedoc": "^0.
|
|
79
|
+
"typedoc": "^0.26.7",
|
|
86
80
|
"typescript": "^5.3.3"
|
|
87
81
|
},
|
|
88
82
|
"jest": {
|
|
@@ -97,11 +91,11 @@
|
|
|
97
91
|
},
|
|
98
92
|
"lint-staged": {
|
|
99
93
|
"*.ts": [
|
|
100
|
-
"npm run lint
|
|
94
|
+
"npm run lint"
|
|
101
95
|
]
|
|
102
96
|
},
|
|
103
97
|
"dependencies": {
|
|
104
|
-
"@equinor/videx-linear-algebra": "^1.0.
|
|
98
|
+
"@equinor/videx-linear-algebra": "^1.0.11",
|
|
105
99
|
"@equinor/videx-math": "^1.1.0",
|
|
106
100
|
"@equinor/videx-vector2": "^1.0.44",
|
|
107
101
|
"d3-color": "^3.1.0",
|
package/dist/EventHandler.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface EventHandlerCallbacks {
|
|
2
|
-
mousemove: (event: MouseEvent) => boolean;
|
|
3
|
-
mouseout: (event: MouseEvent) => boolean;
|
|
4
|
-
mousedown: (event: MouseEvent) => boolean;
|
|
5
|
-
mouseup: (event: MouseEvent) => boolean;
|
|
6
|
-
click: (event: Event) => boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface EventHandler {
|
|
9
|
-
map: L.Map;
|
|
10
|
-
element: HTMLElement;
|
|
11
|
-
callbacks: EventHandlerCallbacks;
|
|
12
|
-
register(map: L.Map, element: HTMLElement, callbacks: EventHandlerCallbacks): void;
|
|
13
|
-
unregister(): void;
|
|
14
|
-
}
|
|
15
|
-
export declare class DefaultEventHandler implements EventHandler {
|
|
16
|
-
map: L.Map;
|
|
17
|
-
element: HTMLElement;
|
|
18
|
-
callbacks: EventHandlerCallbacks;
|
|
19
|
-
register(map: L.Map, element: HTMLElement, callbacks: EventHandlerCallbacks): void;
|
|
20
|
-
unregister(): void;
|
|
21
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import { ModuleInterface } from './ModuleInterface';
|
|
3
|
-
import { RootUniforms } from './utils/wellbores/Shader';
|
|
4
|
-
import PointDictionary from './utils/PointDictionary';
|
|
5
|
-
/**
|
|
6
|
-
* Data assigned each point in point dictionary.
|
|
7
|
-
*/
|
|
8
|
-
interface PointData {
|
|
9
|
-
mesh: PIXI.Mesh;
|
|
10
|
-
uniforms: RootUniforms;
|
|
11
|
-
}
|
|
12
|
-
interface selection {
|
|
13
|
-
point: PointData;
|
|
14
|
-
/** Original z-index. */
|
|
15
|
-
zIndex: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Exploration layer
|
|
19
|
-
*
|
|
20
|
-
* Layer for displaying exploration wells.
|
|
21
|
-
*/
|
|
22
|
-
export default class ExplorationLayer extends ModuleInterface {
|
|
23
|
-
/** Dictionary used to manage points. */
|
|
24
|
-
pointDict: PointDictionary<PointData>;
|
|
25
|
-
/** Initial scale. */
|
|
26
|
-
prevScale: number;
|
|
27
|
-
/** Current selection */
|
|
28
|
-
selection: selection;
|
|
29
|
-
appendExploration(scale?: number): void;
|
|
30
|
-
/**
|
|
31
|
-
* @param scale
|
|
32
|
-
* @returns Clamped scale
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
clampScale(scale: number): number;
|
|
36
|
-
highlight(lat: number, long: number): boolean;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import { ModuleInterface } from './ModuleInterface';
|
|
3
|
-
/** Data format on incoming faultlines */
|
|
4
|
-
interface FaultlineData {
|
|
5
|
-
coordinates: [number, number][];
|
|
6
|
-
geometry: string;
|
|
7
|
-
modelGuid: string;
|
|
8
|
-
omniaUpdateDate: string;
|
|
9
|
-
segID: number;
|
|
10
|
-
source: string;
|
|
11
|
-
sourceCreateDate: string;
|
|
12
|
-
sourceFileName: string;
|
|
13
|
-
sourceUpdateDate: string;
|
|
14
|
-
}
|
|
15
|
-
/** Interface for faultline config. */
|
|
16
|
-
export interface InputConfig {
|
|
17
|
-
/** Color of faultline on format 0xRRGGBB. (Default: 0x727D88) */
|
|
18
|
-
color?: number;
|
|
19
|
-
/** Alpha of faultlines. (Default: 1.0) */
|
|
20
|
-
alpha?: number;
|
|
21
|
-
/** Width of outline. (Default: 0.125) */
|
|
22
|
-
outlineWidth?: number;
|
|
23
|
-
}
|
|
24
|
-
interface Config {
|
|
25
|
-
/** Color of faultline on format 0xRRGGBB. (Default: 0x727D88) */
|
|
26
|
-
color: number;
|
|
27
|
-
/** Alpha of faultlines. (Default: 1.0) */
|
|
28
|
-
alpha: number;
|
|
29
|
-
/** Width of outline. (Default: 0.125) */
|
|
30
|
-
outlineWidth: number;
|
|
31
|
-
}
|
|
32
|
-
/** Module for displaying faultlines. */
|
|
33
|
-
export default class FaultlineModule extends ModuleInterface {
|
|
34
|
-
/** Graphic elements currently existing in world space. */
|
|
35
|
-
spawned: PIXI.Graphics[];
|
|
36
|
-
/** Pool of initialized graphic elements. */
|
|
37
|
-
pool: PIXI.Graphics[];
|
|
38
|
-
/** Default config. */
|
|
39
|
-
config: Config;
|
|
40
|
-
constructor(config?: InputConfig);
|
|
41
|
-
destroy(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Set collection of faultlines to display. Clears previous content on execution.
|
|
44
|
-
* @param data Faultlines to draw
|
|
45
|
-
*/
|
|
46
|
-
set(data: FaultlineData[]): void;
|
|
47
|
-
/** Clear all spawned graphic elements and return to pool. */
|
|
48
|
-
clear(): void;
|
|
49
|
-
resize(_zoom: number): void;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
package/dist/FieldModule.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
import { ModuleInterface } from './ModuleInterface';
|
|
4
|
-
import { MeshData, MeshNormalData } from './utils/Mesh';
|
|
5
|
-
import Highlighter from './utils/fields/Highlighter';
|
|
6
|
-
import LabelManager from './utils/fields/LabelManager';
|
|
7
|
-
import TriangleDictionary from './utils/TriangleDictionary';
|
|
8
|
-
type vec3 = [number, number, number];
|
|
9
|
-
interface FillUniform {
|
|
10
|
-
col1: vec3;
|
|
11
|
-
col2: vec3;
|
|
12
|
-
opacity: number;
|
|
13
|
-
hashed: boolean;
|
|
14
|
-
hashDisp: number;
|
|
15
|
-
hashWidth: number;
|
|
16
|
-
}
|
|
17
|
-
interface OutlineUniform {
|
|
18
|
-
color: vec3;
|
|
19
|
-
width: number;
|
|
20
|
-
}
|
|
21
|
-
/** Collection of data describing colors used for fill. */
|
|
22
|
-
interface FieldStyle {
|
|
23
|
-
fillColor1: vec3;
|
|
24
|
-
fillColor2: vec3;
|
|
25
|
-
fillOpacity: number;
|
|
26
|
-
outlineColor: vec3;
|
|
27
|
-
hashed: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface Field {
|
|
30
|
-
type: string;
|
|
31
|
-
geometry: {
|
|
32
|
-
type: string;
|
|
33
|
-
/**
|
|
34
|
-
* The type of data found within coordinates depends on type.
|
|
35
|
-
* For 'Polygon', coordinates is given as [number, number][][].
|
|
36
|
-
* for 'MultiPolygon', coordinates is given as [number, number][][][].
|
|
37
|
-
*/
|
|
38
|
-
coordinates: [number, number][][] | [number, number][][][];
|
|
39
|
-
};
|
|
40
|
-
properties: {
|
|
41
|
-
discname: string;
|
|
42
|
-
group: number;
|
|
43
|
-
guid?: number;
|
|
44
|
-
hctype: string;
|
|
45
|
-
label: string;
|
|
46
|
-
lat: number;
|
|
47
|
-
long: number;
|
|
48
|
-
polygonId: number;
|
|
49
|
-
status: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export interface FieldMesh {
|
|
53
|
-
fill: {
|
|
54
|
-
mesh: PIXI.Mesh;
|
|
55
|
-
uniform: FillUniform;
|
|
56
|
-
};
|
|
57
|
-
outline: {
|
|
58
|
-
mesh: PIXI.Mesh;
|
|
59
|
-
uniform: OutlineUniform;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/** Interface for field config. */
|
|
63
|
-
interface Config {
|
|
64
|
-
/** Initial scale of field hash (Default: 1.0). */
|
|
65
|
-
initialHash?: number;
|
|
66
|
-
/** Minimum scale of field hash (Default: 0.0). */
|
|
67
|
-
minHash?: number;
|
|
68
|
-
/** Maximum scale of field hash (Default: Infinity). */
|
|
69
|
-
maxHash?: number;
|
|
70
|
-
}
|
|
71
|
-
/** Module for displaying fields. */
|
|
72
|
-
export default class FieldModule extends ModuleInterface {
|
|
73
|
-
/** Vertex shader for the fill. */
|
|
74
|
-
static vertexShaderFill: string;
|
|
75
|
-
/** Fragment shader for the fill. */
|
|
76
|
-
static fragmentShaderFill: string;
|
|
77
|
-
/** Vertex shader for the outlines. */
|
|
78
|
-
static vertexShaderOutline: string;
|
|
79
|
-
/** Fragment shader for the outlines. */
|
|
80
|
-
static fragmentShaderOutline: string;
|
|
81
|
-
/** Collection of fields with meshes. */
|
|
82
|
-
fields: FieldMesh[];
|
|
83
|
-
/** Settings for how to render fields. */
|
|
84
|
-
config: Config;
|
|
85
|
-
dict: TriangleDictionary<number>;
|
|
86
|
-
highlighter: Highlighter;
|
|
87
|
-
labelManager: LabelManager;
|
|
88
|
-
/** Index of previously highlighted field */
|
|
89
|
-
prevField: number;
|
|
90
|
-
constructor(config?: Config);
|
|
91
|
-
set(data: Field[]): void;
|
|
92
|
-
/**
|
|
93
|
-
* Draw each polygon in a polygon collection.
|
|
94
|
-
* @param polygons
|
|
95
|
-
*/
|
|
96
|
-
drawPolygons(meshData: MeshData, outlineData: MeshNormalData, fieldStyle: FieldStyle, zIndex: number): FieldMesh;
|
|
97
|
-
/**
|
|
98
|
-
* Get the fill color of a field.
|
|
99
|
-
* @param props Properties of field
|
|
100
|
-
* @returns Color used to fill
|
|
101
|
-
*/
|
|
102
|
-
getFieldStyle(guid: number, hctype: string): FieldStyle;
|
|
103
|
-
/**
|
|
104
|
-
* Project a collection of polygons.
|
|
105
|
-
* @param points Points within polygons
|
|
106
|
-
* @returns Projected polygons
|
|
107
|
-
*/
|
|
108
|
-
projectPolygons(points: [number, number][]): Vector2[];
|
|
109
|
-
resize(_zoom: number): void;
|
|
110
|
-
highlight(lat: number, long: number): boolean;
|
|
111
|
-
tryUnselect(): void;
|
|
112
|
-
}
|
|
113
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
import { ModuleInterface } from '../ModuleInterface';
|
|
4
|
-
import { EventHandler } from '../EventHandler';
|
|
5
|
-
import { default as GeoJSONMultiPolygon } from './multipolygon';
|
|
6
|
-
import { default as GeoJSONPolygon } from './polygon';
|
|
7
|
-
import { default as GeoJSONLineString } from './linestring';
|
|
8
|
-
import { default as GeoJSONPoint } from './point';
|
|
9
|
-
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
10
|
-
import { FeatureProps } from './interfaces';
|
|
11
|
-
/** Interface for config. */
|
|
12
|
-
interface Config {
|
|
13
|
-
customEventHandler?: EventHandler;
|
|
14
|
-
onFeatureHover?: (event: MouseEvent, data: any) => void;
|
|
15
|
-
outlineResize?: ResizeConfig;
|
|
16
|
-
labelResize?: LabelResizeConfig;
|
|
17
|
-
}
|
|
18
|
-
/** Module for displaying fields. */
|
|
19
|
-
export default class GeoJSONModule extends ModuleInterface {
|
|
20
|
-
onFeatureHover: (event: MouseEvent, data: any) => void;
|
|
21
|
-
points: GeoJSONPoint;
|
|
22
|
-
linestrings: GeoJSONLineString;
|
|
23
|
-
polygons: GeoJSONPolygon;
|
|
24
|
-
multipolygons: GeoJSONMultiPolygon;
|
|
25
|
-
_eventHandler: EventHandler;
|
|
26
|
-
mapmoving: boolean;
|
|
27
|
-
labelRoot: PIXI.Container;
|
|
28
|
-
config?: Config;
|
|
29
|
-
constructor(config?: Config);
|
|
30
|
-
set(data: GeoJSON.FeatureCollection, props?: (feature: any) => FeatureProps): void;
|
|
31
|
-
/**
|
|
32
|
-
* Check for features at the given coordinates.
|
|
33
|
-
* Will give a list of feature data if any are hit or an empty list if not.
|
|
34
|
-
* @param pos Target position in lat-long
|
|
35
|
-
* @returns List of features at the given position
|
|
36
|
-
*/
|
|
37
|
-
testPosition(pos: Vector2): any;
|
|
38
|
-
onAdd(map: import('leaflet').Map): void;
|
|
39
|
-
onRemove(_map: import('leaflet').Map): void;
|
|
40
|
-
resize(zoom: number): void;
|
|
41
|
-
private handleMouseMove;
|
|
42
|
-
private handleMouseOut;
|
|
43
|
-
private handleMouseClick;
|
|
44
|
-
private handleMouseDown;
|
|
45
|
-
private handleMouseUp;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class Defaults {
|
|
2
|
-
static readonly DEFAULT_Z_INDEX = 1000;
|
|
3
|
-
static readonly DEFAULT_LINE_WIDTH = 0.15;
|
|
4
|
-
static readonly INITIAL_ZOOM = 20;
|
|
5
|
-
static readonly DEFAULT_FONT_FAMILY = "Arial";
|
|
6
|
-
static readonly DEFAULT_FONT_SIZE = 64;
|
|
7
|
-
static readonly DEFAULT_FONT_WEIGHT = "600";
|
|
8
|
-
static readonly DEFAULT_LABEL_COLOR = 4539717;
|
|
9
|
-
static readonly DEFAULT_LABEL_ALIGN = "center";
|
|
10
|
-
static readonly INITIAL_HASH = 1;
|
|
11
|
-
static readonly DEFAULT_MIN_HASH = 0;
|
|
12
|
-
static readonly DEFAULT_BASE_SCALE = 0.1;
|
|
13
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as GeoJSONMultiPolygon } from './multipolygon';
|
|
2
|
-
export { default as GeoJSONPolygon } from './polygon';
|
|
3
|
-
export { default as GeoJSONLineString } from './linestring';
|
|
4
|
-
export { default as GeoJSONPoint } from './point';
|
|
5
|
-
export { default as GeoJSONModule } from './GeoJSONModule';
|
|
6
|
-
export * from './interfaces';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface FeatureStyle {
|
|
2
|
-
lineColor: string;
|
|
3
|
-
lineWidth: number;
|
|
4
|
-
fillColor?: string;
|
|
5
|
-
fillColor2?: string;
|
|
6
|
-
fillOpacity?: number;
|
|
7
|
-
hashed?: boolean;
|
|
8
|
-
labelScale?: number;
|
|
9
|
-
}
|
|
10
|
-
export interface FeatureProps {
|
|
11
|
-
id: number;
|
|
12
|
-
label: string;
|
|
13
|
-
style: FeatureStyle;
|
|
14
|
-
additionalData?: any;
|
|
15
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
/** Data for label. */
|
|
4
|
-
export type GeoJSONLabelData = {
|
|
5
|
-
position: Vector2;
|
|
6
|
-
mass: number;
|
|
7
|
-
};
|
|
8
|
-
interface Label {
|
|
9
|
-
name: string;
|
|
10
|
-
position: Vector2;
|
|
11
|
-
instance?: PIXI.BitmapText;
|
|
12
|
-
}
|
|
13
|
-
/** Class used to manage field labels. Handles scaling and grouping of labels. */
|
|
14
|
-
export default class GeoJSONLabels {
|
|
15
|
-
/**PIXI container to hold all labels*/
|
|
16
|
-
container: PIXI.Container;
|
|
17
|
-
/** The textstyle used for labels. */
|
|
18
|
-
textStyle: PIXI.TextStyle;
|
|
19
|
-
/** The font used for labels. */
|
|
20
|
-
font: PIXI.BitmapFont;
|
|
21
|
-
/** font name */
|
|
22
|
-
fontName: string;
|
|
23
|
-
/** Scale of labels when size is set to 1. */
|
|
24
|
-
baseScale: number;
|
|
25
|
-
/** Collection of single-polygon fields. */
|
|
26
|
-
labels: Label[];
|
|
27
|
-
/** Visibility */
|
|
28
|
-
visible: boolean;
|
|
29
|
-
/** construct a new label container. */
|
|
30
|
-
constructor(root: PIXI.Container, textStyle: PIXI.TextStyle, baseScale: number, fontName?: string);
|
|
31
|
-
/**
|
|
32
|
-
* Add a new label.
|
|
33
|
-
* @param name label name
|
|
34
|
-
* @param data Data for each label
|
|
35
|
-
*/
|
|
36
|
-
addLabel(name: string, data: GeoJSONLabelData): void;
|
|
37
|
-
/**
|
|
38
|
-
* Draw all labels
|
|
39
|
-
* @param root Target root for labels
|
|
40
|
-
*/
|
|
41
|
-
draw(): void;
|
|
42
|
-
hideLabels(): void;
|
|
43
|
-
showLabels(): void;
|
|
44
|
-
resize(scale: number): void;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
-
import { MeshNormalData } from '../utils/Mesh';
|
|
5
|
-
import LineDictionary from '../utils/LineDictionary';
|
|
6
|
-
import { FeatureProps, FeatureStyle } from '.';
|
|
7
|
-
import { ResizeConfig } from '../ResizeConfigInterface';
|
|
8
|
-
type vec3 = [number, number, number];
|
|
9
|
-
interface OutlineUniform {
|
|
10
|
-
color: vec3;
|
|
11
|
-
width: number;
|
|
12
|
-
}
|
|
13
|
-
export interface FeatureMesh {
|
|
14
|
-
outline: {
|
|
15
|
-
mesh: PIXI.Mesh;
|
|
16
|
-
uniform: OutlineUniform;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/** Interface for field config. */
|
|
20
|
-
interface Config {
|
|
21
|
-
outlineResize?: ResizeConfig;
|
|
22
|
-
}
|
|
23
|
-
/** Module for displaying fields. */
|
|
24
|
-
export default class GeoJSONLineString {
|
|
25
|
-
/** Vertex shader for the outlines. */
|
|
26
|
-
static vertexShaderOutline: string;
|
|
27
|
-
/** Fragment shader for the outlines. */
|
|
28
|
-
static fragmentShaderOutline: string;
|
|
29
|
-
/** Collection of features with meshes. */
|
|
30
|
-
features: FeatureMesh[];
|
|
31
|
-
/** Settings for how to render fields. */
|
|
32
|
-
config: Config;
|
|
33
|
-
container: PIXI.Container;
|
|
34
|
-
pixiOverlay: pixiOverlayBase;
|
|
35
|
-
dict: LineDictionary<any>;
|
|
36
|
-
textStyle: PIXI.TextStyle;
|
|
37
|
-
currentZoom: number;
|
|
38
|
-
constructor(root: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
39
|
-
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
40
|
-
/**
|
|
41
|
-
* Draw each polygon in a polygon collection.
|
|
42
|
-
* @param polygons
|
|
43
|
-
*/
|
|
44
|
-
drawPolygons(container: PIXI.Container, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
|
|
45
|
-
/**
|
|
46
|
-
* Project a collection of polygons.
|
|
47
|
-
* @param points Points within polygons
|
|
48
|
-
* @returns Projected polygons
|
|
49
|
-
*/
|
|
50
|
-
projectPolygons(points: [number, number][]): Vector2[];
|
|
51
|
-
resize(zoom: number): void;
|
|
52
|
-
testPosition(pos: Vector2): number;
|
|
53
|
-
getOutlineRadius(zoom?: number): number;
|
|
54
|
-
}
|
|
55
|
-
export {};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
-
import { MeshData, MeshNormalData } from '../utils/Mesh';
|
|
5
|
-
import GeoJSONLabels from './labels';
|
|
6
|
-
import TriangleDictionary from '../utils/TriangleDictionary';
|
|
7
|
-
import { FeatureProps, FeatureStyle } from '.';
|
|
8
|
-
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
9
|
-
type vec3 = [number, number, number];
|
|
10
|
-
interface FillUniform {
|
|
11
|
-
col1: vec3;
|
|
12
|
-
col2: vec3;
|
|
13
|
-
opacity: number;
|
|
14
|
-
hashed: boolean;
|
|
15
|
-
hashDisp: number;
|
|
16
|
-
hashWidth: number;
|
|
17
|
-
}
|
|
18
|
-
interface OutlineUniform {
|
|
19
|
-
color: vec3;
|
|
20
|
-
outlineWidth: number;
|
|
21
|
-
}
|
|
22
|
-
export interface FeatureMesh {
|
|
23
|
-
fill: {
|
|
24
|
-
mesh: PIXI.Mesh;
|
|
25
|
-
uniform: FillUniform;
|
|
26
|
-
};
|
|
27
|
-
outline: {
|
|
28
|
-
mesh: PIXI.Mesh;
|
|
29
|
-
uniform: OutlineUniform;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/** Interface for feature config. */
|
|
33
|
-
interface Config {
|
|
34
|
-
/** Initial scale of feature hash (Default: 1.0). */
|
|
35
|
-
initialHash?: number;
|
|
36
|
-
/** Minimum scale of feature hash (Default: 0.0). */
|
|
37
|
-
minHash?: number;
|
|
38
|
-
/** Maximum scale of feature hash (Default: Infinity). */
|
|
39
|
-
maxHash?: number;
|
|
40
|
-
/**Label font family, default Arial */
|
|
41
|
-
labelFontFamily?: string;
|
|
42
|
-
/**Label font size, default 64 */
|
|
43
|
-
labelFontSize?: number;
|
|
44
|
-
/**Label font weight, default 600 */
|
|
45
|
-
labelFontWeight?: string;
|
|
46
|
-
/**Label fill color, default 0x454545 */
|
|
47
|
-
labelColor?: string | number;
|
|
48
|
-
/**Label alignment, default Center */
|
|
49
|
-
labelAlign?: string;
|
|
50
|
-
/** Resize configuration for outline. */
|
|
51
|
-
outlineResize?: ResizeConfig;
|
|
52
|
-
/** Resize configuration for labels. */
|
|
53
|
-
labelResize?: LabelResizeConfig;
|
|
54
|
-
}
|
|
55
|
-
/** Container for GeoJSON Polygon features. */
|
|
56
|
-
export default class GeoJSONMultiPolygon {
|
|
57
|
-
/** Vertex shader for the fill. */
|
|
58
|
-
static vertexShaderFill: string;
|
|
59
|
-
/** Fragment shader for the fill. */
|
|
60
|
-
static fragmentShaderFill: string;
|
|
61
|
-
/** Vertex shader for the outlines. */
|
|
62
|
-
static vertexShaderOutline: string;
|
|
63
|
-
/** Fragment shader for the outlines. */
|
|
64
|
-
static fragmentShaderOutline: string;
|
|
65
|
-
/** Collection of features with meshes. */
|
|
66
|
-
features: FeatureMesh[];
|
|
67
|
-
/** Settings for how to render data. */
|
|
68
|
-
config: Config;
|
|
69
|
-
container: PIXI.Container;
|
|
70
|
-
pixiOverlay: pixiOverlayBase;
|
|
71
|
-
dict: TriangleDictionary<any>;
|
|
72
|
-
textStyle: PIXI.TextStyle;
|
|
73
|
-
labels: GeoJSONLabels;
|
|
74
|
-
currentZoom: number;
|
|
75
|
-
constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
76
|
-
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
77
|
-
/**
|
|
78
|
-
* Draw each polygon in a polygon collection.
|
|
79
|
-
* @param polygons
|
|
80
|
-
*/
|
|
81
|
-
drawPolygons(container: PIXI.Container, meshData: MeshData, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
|
|
82
|
-
drawLabels(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Project a collection of polygons.
|
|
85
|
-
* @param points Points within polygons
|
|
86
|
-
* @returns Projected polygons
|
|
87
|
-
*/
|
|
88
|
-
projectPolygons(points: [number, number][]): Vector2[];
|
|
89
|
-
resize(zoom: number): void;
|
|
90
|
-
testPosition(pos: Vector2): number;
|
|
91
|
-
getOutlineRadius(zoom?: number): number;
|
|
92
|
-
getLabelSize(zoom?: number): number;
|
|
93
|
-
}
|
|
94
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as PIXI from 'pixi.js';
|
|
2
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
3
|
-
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
4
|
-
import PointDictionary from '../utils/PointDictionary';
|
|
5
|
-
import { FeatureProps } from '.';
|
|
6
|
-
/** Module for displaying fields. */
|
|
7
|
-
export default class GeoJSONPoint {
|
|
8
|
-
/** Graphic elements currently existing in world space. */
|
|
9
|
-
spawned: PIXI.Graphics[];
|
|
10
|
-
/** Pool of initialized graphic elements. */
|
|
11
|
-
pool: PIXI.Graphics[];
|
|
12
|
-
container: PIXI.Container;
|
|
13
|
-
pixiOverlay: pixiOverlayBase;
|
|
14
|
-
dict: PointDictionary<any>;
|
|
15
|
-
textStyle: PIXI.TextStyle;
|
|
16
|
-
constructor(root: PIXI.Container, pixiOverlay: pixiOverlayBase);
|
|
17
|
-
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
18
|
-
/**
|
|
19
|
-
* Project a point coordinate.
|
|
20
|
-
* @param point x,y pair
|
|
21
|
-
* @returns Projected point
|
|
22
|
-
*/
|
|
23
|
-
projectPoint(point: [number, number]): Vector2;
|
|
24
|
-
resize(_zoom: number): void;
|
|
25
|
-
testPosition(pos: Vector2): any;
|
|
26
|
-
}
|