@equinor/videx-map 1.14.3 → 1.14.5

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 (66) hide show
  1. package/dist/EventHandler.d.ts +21 -21
  2. package/dist/ExplorationLayer.d.ts +38 -38
  3. package/dist/FaultlineModule.d.ts +51 -51
  4. package/dist/FieldModule.d.ts +113 -113
  5. package/dist/GeoJSONModule/GeoJSONModule.d.ts +47 -47
  6. package/dist/GeoJSONModule/constants.d.ts +13 -13
  7. package/dist/GeoJSONModule/index.d.ts +6 -6
  8. package/dist/GeoJSONModule/interfaces.d.ts +15 -15
  9. package/dist/GeoJSONModule/labels.d.ts +46 -46
  10. package/dist/GeoJSONModule/linestring.d.ts +55 -55
  11. package/dist/GeoJSONModule/multipolygon.d.ts +94 -94
  12. package/dist/GeoJSONModule/point.d.ts +26 -26
  13. package/dist/GeoJSONModule/polygon.d.ts +96 -96
  14. package/dist/GeoJSONModule/shader.d.ts +10 -10
  15. package/dist/ModuleInterface.d.ts +26 -26
  16. package/dist/OutlineModule.d.ts +81 -81
  17. package/dist/ResizeConfigInterface.d.ts +14 -14
  18. package/dist/WellboreModule.d.ts +126 -126
  19. package/dist/index.d.ts +8 -8
  20. package/dist/pixiOverlayInterfaces.d.ts +16 -16
  21. package/dist/utils/ComparableArray.d.ts +60 -60
  22. package/dist/utils/LineDictionary.d.ts +89 -89
  23. package/dist/utils/LineInterpolator.d.ts +84 -84
  24. package/dist/utils/Log.d.ts +1 -1
  25. package/dist/utils/Mesh.d.ts +46 -46
  26. package/dist/utils/PointDictionary.d.ts +58 -58
  27. package/dist/utils/Radius.d.ts +2 -2
  28. package/dist/utils/Rect.d.ts +27 -27
  29. package/dist/utils/TriangleDictionary.d.ts +21 -21
  30. package/dist/utils/WellboreMesh.d.ts +51 -51
  31. package/dist/utils/centerOfMass.d.ts +8 -8
  32. package/dist/utils/fields/Highlighter.d.ts +33 -33
  33. package/dist/utils/fields/LabelManager.d.ts +62 -62
  34. package/dist/utils/fields/groupLabels.d.ts +5 -5
  35. package/dist/utils/fields/preprocessFields.d.ts +29 -29
  36. package/dist/utils/generateCircle.d.ts +10 -10
  37. package/dist/utils/linePoint.d.ts +27 -27
  38. package/dist/utils/lineReducer.d.ts +9 -9
  39. package/dist/utils/wellbores/AsyncLoop.d.ts +35 -35
  40. package/dist/utils/wellbores/Colors.d.ts +40 -40
  41. package/dist/utils/wellbores/Config.d.ts +80 -80
  42. package/dist/utils/wellbores/DataManager.d.ts +15 -15
  43. package/dist/utils/wellbores/Highlight.d.ts +18 -18
  44. package/dist/utils/wellbores/LabelType.d.ts +9 -9
  45. package/dist/utils/wellbores/Projector.d.ts +20 -20
  46. package/dist/utils/wellbores/RealtimeWellbore.d.ts +21 -21
  47. package/dist/utils/wellbores/Shader.d.ts +41 -41
  48. package/dist/utils/wellbores/data/Group.d.ts +48 -48
  49. package/dist/utils/wellbores/data/RootData.d.ts +29 -29
  50. package/dist/utils/wellbores/data/SourceData.d.ts +25 -25
  51. package/dist/utils/wellbores/data/WellboreData.d.ts +76 -76
  52. package/dist/utils/wellbores/data/WellboreEventData.d.ts +16 -16
  53. package/dist/utils/wellbores/data/details/Detail.d.ts +20 -20
  54. package/dist/utils/wellbores/data/details/DetailOptions.d.ts +7 -7
  55. package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +14 -14
  56. package/dist/utils/wellbores/data/details/index.d.ts +11 -11
  57. package/dist/utils/wellbores/data/index.d.ts +6 -6
  58. package/dist/utils/wellbores/highlight-helper.d.ts +6 -6
  59. package/dist/utils/wellbores/intervals.d.ts +15 -15
  60. package/dist/utils/wellbores/labels/Label.d.ts +39 -39
  61. package/dist/utils/wellbores/labels/index.d.ts +2 -2
  62. package/dist/utils/wellbores/labels/label-helper.d.ts +3 -3
  63. package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -23
  64. package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -22
  65. package/dist/utils/wellbores/registries/index.d.ts +2 -2
  66. package/package.json +23 -13
@@ -1,46 +1,46 @@
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
+ 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 +1,55 @@
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
+ 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 +1,94 @@
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
+ 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 +1,26 @@
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
- }
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
+ }
@@ -1,96 +1,96 @@
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 of outline. */
51
- outlineResize?: ResizeConfig;
52
- /** Resize configuration for labels. */
53
- labelResize?: LabelResizeConfig;
54
- }
55
- /** Container for GeoJSON Polygon features. */
56
- export default class GeoJSONPolygon {
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
- outlineThickness: number;
76
- zIndex: number;
77
- constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
78
- add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
79
- /**
80
- * Draw each polygon in a polygon collection.
81
- * @param polygons
82
- */
83
- drawPolygons(container: PIXI.Container, meshData: MeshData, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
84
- drawLabels(): void;
85
- /**
86
- * Project a collection of polygons.
87
- * @param points Points within polygons
88
- * @returns Projected polygons
89
- */
90
- projectPolygons(points: [number, number][]): Vector2[];
91
- resize(zoom: number): void;
92
- testPosition(pos: Vector2): any;
93
- getOutlineRadius(zoom?: number): number;
94
- getLabelSize(zoom?: number): number;
95
- }
96
- export {};
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 of outline. */
51
+ outlineResize?: ResizeConfig;
52
+ /** Resize configuration for labels. */
53
+ labelResize?: LabelResizeConfig;
54
+ }
55
+ /** Container for GeoJSON Polygon features. */
56
+ export default class GeoJSONPolygon {
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
+ outlineThickness: number;
76
+ zIndex: number;
77
+ constructor(root: PIXI.Container, labelRoot: PIXI.Container, pixiOverlay: pixiOverlayBase, config?: Config);
78
+ add(feature: GeoJSON.Feature, props: (feature: object) => FeatureProps): void;
79
+ /**
80
+ * Draw each polygon in a polygon collection.
81
+ * @param polygons
82
+ */
83
+ drawPolygons(container: PIXI.Container, meshData: MeshData, outlineData: MeshNormalData, featureStyle: FeatureStyle, zIndex: number): FeatureMesh;
84
+ drawLabels(): void;
85
+ /**
86
+ * Project a collection of polygons.
87
+ * @param points Points within polygons
88
+ * @returns Projected polygons
89
+ */
90
+ projectPolygons(points: [number, number][]): Vector2[];
91
+ resize(zoom: number): void;
92
+ testPosition(pos: Vector2): any;
93
+ getOutlineRadius(zoom?: number): number;
94
+ getLabelSize(zoom?: number): number;
95
+ }
96
+ export {};
@@ -1,10 +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 ";
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 ";