@equinor/videx-map 1.11.0 → 1.12.2
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/LICENSE +21 -21
- package/dist/FaultlineModule.d.ts +1 -0
- package/dist/GeoJSONModule/GeoJSONModule.d.ts +10 -1
- package/dist/GeoJSONModule/constants.d.ts +13 -0
- package/dist/GeoJSONModule/index.d.ts +1 -15
- package/dist/GeoJSONModule/interfaces.d.ts +15 -0
- package/dist/GeoJSONModule/labels.d.ts +1 -0
- package/dist/GeoJSONModule/linestring.d.ts +5 -1
- package/dist/GeoJSONModule/multipolygon.d.ts +10 -2
- package/dist/GeoJSONModule/point.d.ts +1 -1
- package/dist/GeoJSONModule/polygon.d.ts +12 -2
- package/dist/GeoJSONModule/shader.d.ts +10 -0
- package/dist/ModuleInterface.d.ts +1 -0
- package/dist/ResizeConfigInterface.d.ts +14 -0
- package/dist/WellboreModule.d.ts +2 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/utils/Radius.d.ts +2 -0
- package/dist/utils/wellbores/AsyncLoop.d.ts +3 -2
- package/dist/utils/wellbores/Config.d.ts +2 -11
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Equinor
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Equinor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -38,6 +38,7 @@ export default class FaultlineModule extends ModuleInterface {
|
|
|
38
38
|
/** Default config. */
|
|
39
39
|
config: Config;
|
|
40
40
|
constructor(config?: InputConfig);
|
|
41
|
+
destroy(): void;
|
|
41
42
|
/**
|
|
42
43
|
* Set collection of faultlines to display. Clears previous content on execution.
|
|
43
44
|
* @param data Faultlines to draw
|
|
@@ -2,11 +2,18 @@ import * as PIXI from 'pixi.js';
|
|
|
2
2
|
import Vector2 from '@equinor/videx-vector2';
|
|
3
3
|
import { ModuleInterface } from '../ModuleInterface';
|
|
4
4
|
import { EventHandler } from '../EventHandler';
|
|
5
|
-
import {
|
|
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';
|
|
6
11
|
/** Interface for config. */
|
|
7
12
|
interface Config {
|
|
8
13
|
customEventHandler?: EventHandler;
|
|
9
14
|
onFeatureHover?: (event: MouseEvent, data: any) => void;
|
|
15
|
+
outlineResize?: ResizeConfig;
|
|
16
|
+
labelResize?: LabelResizeConfig;
|
|
10
17
|
}
|
|
11
18
|
/** Module for displaying fields. */
|
|
12
19
|
export default class GeoJSONModule extends ModuleInterface {
|
|
@@ -18,6 +25,7 @@ export default class GeoJSONModule extends ModuleInterface {
|
|
|
18
25
|
_eventHandler: EventHandler;
|
|
19
26
|
mapmoving: boolean;
|
|
20
27
|
labelRoot: PIXI.Container;
|
|
28
|
+
config?: Config;
|
|
21
29
|
constructor(config?: Config);
|
|
22
30
|
set(data: GeoJSON.FeatureCollection, props?: (feature: any) => FeatureProps): void;
|
|
23
31
|
/**
|
|
@@ -29,6 +37,7 @@ export default class GeoJSONModule extends ModuleInterface {
|
|
|
29
37
|
testPosition(pos: Vector2): any;
|
|
30
38
|
onAdd(map: import("leaflet").Map): void;
|
|
31
39
|
onRemove(map: import("leaflet").Map): void;
|
|
40
|
+
resize(zoom: number): void;
|
|
32
41
|
private handleMouseMove;
|
|
33
42
|
private handleMouseOut;
|
|
34
43
|
private handleMouseClick;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
@@ -3,18 +3,4 @@ export { default as GeoJSONPolygon } from './polygon';
|
|
|
3
3
|
export { default as GeoJSONLineString } from './linestring';
|
|
4
4
|
export { default as GeoJSONPoint } from './point';
|
|
5
5
|
export { default as GeoJSONModule } from './GeoJSONModule';
|
|
6
|
-
export
|
|
7
|
-
lineColor: string;
|
|
8
|
-
lineWidth: number;
|
|
9
|
-
fillColor?: string;
|
|
10
|
-
fillColor2?: string;
|
|
11
|
-
fillOpacity?: number;
|
|
12
|
-
hashed?: boolean;
|
|
13
|
-
labelScale?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface FeatureProps {
|
|
16
|
-
id: number;
|
|
17
|
-
label: string;
|
|
18
|
-
style: FeatureStyle;
|
|
19
|
-
additionalData?: any;
|
|
20
|
-
}
|
|
6
|
+
export * from './interfaces';
|
|
@@ -0,0 +1,15 @@
|
|
|
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,9 +1,10 @@
|
|
|
1
1
|
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
3
|
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
3
4
|
import { MeshNormalData } from '../utils/Mesh';
|
|
4
5
|
import LineDictionary from '../utils/LineDictionary';
|
|
5
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
6
6
|
import { FeatureProps, FeatureStyle } from '.';
|
|
7
|
+
import { ResizeConfig } from '../ResizeConfigInterface';
|
|
7
8
|
declare type vec3 = [number, number, number];
|
|
8
9
|
interface OutlineUniform {
|
|
9
10
|
color: vec3;
|
|
@@ -17,6 +18,7 @@ export interface FeatureMesh {
|
|
|
17
18
|
}
|
|
18
19
|
/** Interface for field config. */
|
|
19
20
|
interface Config {
|
|
21
|
+
outlineResize?: ResizeConfig;
|
|
20
22
|
}
|
|
21
23
|
/** Module for displaying fields. */
|
|
22
24
|
export default class GeoJSONLineString {
|
|
@@ -32,6 +34,7 @@ export default class GeoJSONLineString {
|
|
|
32
34
|
pixiOverlay: pixiOverlayBase;
|
|
33
35
|
dict: LineDictionary<any>;
|
|
34
36
|
textStyle: PIXI.TextStyle;
|
|
37
|
+
currentZoom: number;
|
|
35
38
|
constructor(root: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
36
39
|
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
37
40
|
/**
|
|
@@ -47,5 +50,6 @@ export default class GeoJSONLineString {
|
|
|
47
50
|
projectPolygons(points: [number, number][]): Vector2[];
|
|
48
51
|
resize(zoom: number): void;
|
|
49
52
|
testPosition(pos: Vector2): any;
|
|
53
|
+
getOutlineRadius(zoom?: number): number;
|
|
50
54
|
}
|
|
51
55
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
3
|
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
3
4
|
import { MeshData, MeshNormalData } from '../utils/Mesh';
|
|
4
5
|
import GeoJSONLabels from './labels';
|
|
5
6
|
import TriangleDictionary from '../utils/TriangleDictionary';
|
|
6
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
7
7
|
import { FeatureProps, FeatureStyle } from '.';
|
|
8
|
+
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
8
9
|
declare type vec3 = [number, number, number];
|
|
9
10
|
interface FillUniform {
|
|
10
11
|
col1: vec3;
|
|
@@ -16,7 +17,7 @@ interface FillUniform {
|
|
|
16
17
|
}
|
|
17
18
|
interface OutlineUniform {
|
|
18
19
|
color: vec3;
|
|
19
|
-
|
|
20
|
+
outlineWidth: number;
|
|
20
21
|
}
|
|
21
22
|
export interface FeatureMesh {
|
|
22
23
|
fill: {
|
|
@@ -46,6 +47,10 @@ interface Config {
|
|
|
46
47
|
labelColor?: string | number;
|
|
47
48
|
/**Label alignment, default Center */
|
|
48
49
|
labelAlign?: string;
|
|
50
|
+
/** Resize configuration for outline. */
|
|
51
|
+
outlineResize?: ResizeConfig;
|
|
52
|
+
/** Resize configuration for labels. */
|
|
53
|
+
labelResize?: LabelResizeConfig;
|
|
49
54
|
}
|
|
50
55
|
/** Container for GeoJSON Polygon features. */
|
|
51
56
|
export default class GeoJSONMultiPolygon {
|
|
@@ -66,6 +71,7 @@ export default class GeoJSONMultiPolygon {
|
|
|
66
71
|
dict: TriangleDictionary<any>;
|
|
67
72
|
textStyle: PIXI.TextStyle;
|
|
68
73
|
labels: GeoJSONLabels;
|
|
74
|
+
currentZoom: number;
|
|
69
75
|
constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
70
76
|
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
71
77
|
/**
|
|
@@ -82,5 +88,7 @@ export default class GeoJSONMultiPolygon {
|
|
|
82
88
|
projectPolygons(points: [number, number][]): Vector2[];
|
|
83
89
|
resize(zoom: number): void;
|
|
84
90
|
testPosition(pos: Vector2): any;
|
|
91
|
+
getOutlineRadius(zoom?: number): number;
|
|
92
|
+
getLabelSize(zoom?: number): number;
|
|
85
93
|
}
|
|
86
94
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
3
|
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
3
4
|
import PointDictionary from '../utils/PointDictionary';
|
|
4
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
5
5
|
import { FeatureProps } from '.';
|
|
6
6
|
/** Module for displaying fields. */
|
|
7
7
|
export default class GeoJSONPoint {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as PIXI from 'pixi.js';
|
|
2
|
+
import Vector2 from '@equinor/videx-vector2';
|
|
2
3
|
import { pixiOverlayBase } from '../pixiOverlayInterfaces';
|
|
3
4
|
import { MeshData, MeshNormalData } from '../utils/Mesh';
|
|
4
5
|
import GeoJSONLabels from './labels';
|
|
5
6
|
import TriangleDictionary from '../utils/TriangleDictionary';
|
|
6
|
-
import Vector2 from '@equinor/videx-vector2';
|
|
7
7
|
import { FeatureProps, FeatureStyle } from '.';
|
|
8
|
+
import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
|
|
8
9
|
declare type vec3 = [number, number, number];
|
|
9
10
|
interface FillUniform {
|
|
10
11
|
col1: vec3;
|
|
@@ -16,7 +17,7 @@ interface FillUniform {
|
|
|
16
17
|
}
|
|
17
18
|
interface OutlineUniform {
|
|
18
19
|
color: vec3;
|
|
19
|
-
|
|
20
|
+
outlineWidth: number;
|
|
20
21
|
}
|
|
21
22
|
export interface FeatureMesh {
|
|
22
23
|
fill: {
|
|
@@ -46,6 +47,10 @@ interface Config {
|
|
|
46
47
|
labelColor?: string | number;
|
|
47
48
|
/**Label alignment, default Center */
|
|
48
49
|
labelAlign?: string;
|
|
50
|
+
/** Resize configuration of outline. */
|
|
51
|
+
outlineResize?: ResizeConfig;
|
|
52
|
+
/** Resize configuration for labels. */
|
|
53
|
+
labelResize?: LabelResizeConfig;
|
|
49
54
|
}
|
|
50
55
|
/** Container for GeoJSON Polygon features. */
|
|
51
56
|
export default class GeoJSONPolygon {
|
|
@@ -66,6 +71,9 @@ export default class GeoJSONPolygon {
|
|
|
66
71
|
dict: TriangleDictionary<any>;
|
|
67
72
|
textStyle: PIXI.TextStyle;
|
|
68
73
|
labels: GeoJSONLabels;
|
|
74
|
+
currentZoom: number;
|
|
75
|
+
outlineThickness: number;
|
|
76
|
+
zIndex: number;
|
|
69
77
|
constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
|
|
70
78
|
add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
|
|
71
79
|
/**
|
|
@@ -82,5 +90,7 @@ export default class GeoJSONPolygon {
|
|
|
82
90
|
projectPolygons(points: [number, number][]): Vector2[];
|
|
83
91
|
resize(zoom: number): void;
|
|
84
92
|
testPosition(pos: Vector2): any;
|
|
93
|
+
getOutlineRadius(zoom?: number): number;
|
|
94
|
+
getLabelSize(zoom?: number): number;
|
|
85
95
|
}
|
|
86
96
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared shaders for polygon and multipolygon
|
|
3
|
+
*/
|
|
4
|
+
export declare const GeoJSONVertexShaderFill = "\n attribute vec2 inputVerts;\n\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n\n varying vec2 verts;\n\n void main() {\n verts = inputVerts;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(inputVerts, 1.0)).xy, 0.0, 1.0);\n }\n ";
|
|
5
|
+
export declare const GeoJSONFragmentShaderFill = "\n precision mediump float;\n\n varying vec2 verts;\n\n uniform vec3 col1;\n uniform vec3 col2;\n uniform float opacity;\n\n uniform bool hashed;\n uniform float hashDisp;\n uniform float hashWidth;\n\n void main() {\n if(hashed && mod(verts.y + hashDisp, hashWidth * 2.0) > hashWidth) {\n gl_FragColor = vec4(col2 / 255., 1.0) * opacity;\n }\n else {\n gl_FragColor = vec4(col1 / 255., 1.0) * opacity;\n }\n }\n ";
|
|
6
|
+
/**
|
|
7
|
+
* Shared shaders for polygon, multipolygon and linestring
|
|
8
|
+
*/
|
|
9
|
+
export declare const GeoJSONVertexShaderOutline = "\n attribute vec2 inputVerts;\n attribute vec2 inputNormals;\n\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n\n uniform float outlineWidth;\n\n void main() {\n vec2 pos = inputVerts + inputNormals * outlineWidth;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(pos, 1.0)).xy, 0.0, 1.0);\n }\n ";
|
|
10
|
+
export declare const GeoJSONFragmentShaderOutline = "\n precision mediump float;\n\n uniform vec3 color;\n\n void main() {\n gl_FragColor = vec4(color / 255., 1.0);\n }\n ";
|
package/dist/WellboreModule.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export default class WellboreModule extends ModuleInterface {
|
|
|
31
31
|
scaling: (zoom: number) => number;
|
|
32
32
|
marker: PIXI.Graphics;
|
|
33
33
|
constructor(inputConfig?: InputConfig);
|
|
34
|
+
destroy(): void;
|
|
34
35
|
registerGroup(key: string, options?: GroupOptions): void;
|
|
35
36
|
private addRoot;
|
|
36
37
|
/**
|
|
@@ -39,7 +40,7 @@ export default class WellboreModule extends ModuleInterface {
|
|
|
39
40
|
* @param data wellbore data
|
|
40
41
|
*/
|
|
41
42
|
addWellbore(data: SourceData, group?: Group): void;
|
|
42
|
-
set(wells: SourceData[], key?: string): Promise<void>;
|
|
43
|
+
set(wells: SourceData[], key?: string, batchSize?: number): Promise<void>;
|
|
43
44
|
private forEachGroup;
|
|
44
45
|
private setActive;
|
|
45
46
|
/**
|