@deck.gl/extensions 8.8.0-alpha.6 → 8.8.0-beta.3
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/dist.dev.js +311 -1166
- package/dist/es5/brushing/brushing.js +19 -15
- package/dist/es5/brushing/brushing.js.map +1 -1
- package/dist/es5/brushing/shader-module.js +1 -1
- package/dist/es5/brushing/shader-module.js.map +1 -1
- package/dist/es5/clip/clip.js +4 -2
- package/dist/es5/clip/clip.js.map +1 -1
- package/dist/es5/data-filter/aggregator.js +1 -1
- package/dist/es5/data-filter/aggregator.js.map +1 -1
- package/dist/es5/data-filter/data-filter.js +9 -9
- package/dist/es5/data-filter/data-filter.js.map +1 -1
- package/dist/es5/data-filter/shader-module.js +22 -13
- package/dist/es5/data-filter/shader-module.js.map +1 -1
- package/dist/es5/fill-style/fill-style.js +13 -11
- package/dist/es5/fill-style/fill-style.js.map +1 -1
- package/dist/es5/fill-style/shaders.glsl.js +8 -6
- package/dist/es5/fill-style/shaders.glsl.js.map +1 -1
- package/dist/es5/fp64/fp64.js +4 -2
- package/dist/es5/fp64/fp64.js.map +1 -1
- package/dist/es5/fp64/project64.glsl.js +1 -1
- package/dist/es5/fp64/project64.js +2 -5
- package/dist/es5/fp64/project64.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/mask/mask.js +7 -4
- package/dist/es5/mask/mask.js.map +1 -1
- package/dist/es5/mask/shader-module.js +6 -7
- package/dist/es5/mask/shader-module.js.map +1 -1
- package/dist/es5/path-style/path-style.js +5 -5
- package/dist/es5/path-style/path-style.js.map +1 -1
- package/dist/es5/path-style/shaders.glsl.js +1 -1
- package/dist/es5/path-style/shaders.glsl.js.map +1 -1
- package/dist/esm/brushing/brushing.js +20 -15
- package/dist/esm/brushing/brushing.js.map +1 -1
- package/dist/esm/brushing/shader-module.js +1 -1
- package/dist/esm/brushing/shader-module.js.map +1 -1
- package/dist/esm/clip/clip.js +5 -2
- package/dist/esm/clip/clip.js.map +1 -1
- package/dist/esm/data-filter/aggregator.js +1 -1
- package/dist/esm/data-filter/aggregator.js.map +1 -1
- package/dist/esm/data-filter/data-filter.js +6 -3
- package/dist/esm/data-filter/data-filter.js.map +1 -1
- package/dist/esm/data-filter/shader-module.js +21 -21
- package/dist/esm/data-filter/shader-module.js.map +1 -1
- package/dist/esm/fill-style/fill-style.js +18 -13
- package/dist/esm/fill-style/fill-style.js.map +1 -1
- package/dist/esm/fill-style/shaders.glsl.js +6 -2
- package/dist/esm/fill-style/shaders.glsl.js.map +1 -1
- package/dist/esm/fp64/fp64.js +4 -2
- package/dist/esm/fp64/fp64.js.map +1 -1
- package/dist/esm/fp64/project64.glsl.js +1 -1
- package/dist/esm/fp64/project64.glsl.js.map +1 -1
- package/dist/esm/fp64/project64.js +2 -3
- package/dist/esm/fp64/project64.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mask/mask.js +7 -4
- package/dist/esm/mask/mask.js.map +1 -1
- package/dist/esm/mask/shader-module.js +6 -6
- package/dist/esm/mask/shader-module.js.map +1 -1
- package/dist/esm/path-style/path-style.js +6 -5
- package/dist/esm/path-style/path-style.js.map +1 -1
- package/dist/esm/path-style/shaders.glsl.js +1 -1
- package/dist/esm/path-style/shaders.glsl.js.map +1 -1
- package/dist.min.js +1 -1
- package/package.json +5 -3
- package/src/brushing/{brushing.js → brushing.ts} +45 -17
- package/src/brushing/{shader-module.js → shader-module.ts} +13 -3
- package/src/clip/{clip.js → clip.ts} +26 -9
- package/src/data-filter/{aggregator.js → aggregator.ts} +12 -8
- package/src/data-filter/{data-filter.js → data-filter.ts} +90 -13
- package/src/data-filter/{shader-module.js → shader-module.ts} +36 -27
- package/src/fill-style/{fill-style.js → fill-style.ts} +83 -19
- package/src/fill-style/{shaders.glsl.js → shaders.glsl.ts} +24 -4
- package/src/fp64/{fp64.js → fp64.ts} +6 -3
- package/src/fp64/{project64.glsl.js → project64.glsl.ts} +0 -0
- package/src/fp64/{project64.js → project64.ts} +16 -5
- package/src/index.ts +8 -0
- package/src/mask/{mask.js → mask.ts} +25 -8
- package/src/mask/{shader-module.js → shader-module.ts} +14 -6
- package/src/path-style/{path-style.js → path-style.ts} +65 -14
- package/src/path-style/{shaders.glsl.js → shaders.glsl.ts} +0 -0
- package/typed/brushing/brushing.d.ts +37 -16
- package/typed/brushing/brushing.d.ts.map +1 -1
- package/typed/brushing/shader-module.d.ts +9 -24
- package/typed/brushing/shader-module.d.ts.map +1 -1
- package/typed/clip/clip.d.ts +27 -10
- package/typed/clip/clip.d.ts.map +1 -1
- package/typed/data-filter/aggregator.d.ts +10 -9
- package/typed/data-filter/aggregator.d.ts.map +1 -1
- package/typed/data-filter/data-filter.d.ts +87 -29
- package/typed/data-filter/data-filter.d.ts.map +1 -1
- package/typed/data-filter/shader-module.d.ts +7 -24
- package/typed/data-filter/shader-module.d.ts.map +1 -1
- package/typed/fill-style/fill-style.d.ts +74 -41
- package/typed/fill-style/fill-style.d.ts.map +1 -1
- package/typed/fill-style/shaders.glsl.d.ts +8 -33
- package/typed/fill-style/shaders.glsl.d.ts.map +1 -1
- package/typed/fp64/fp64.d.ts +6 -6
- package/typed/fp64/fp64.d.ts.map +1 -1
- package/typed/fp64/project64.d.ts +5 -9
- package/typed/fp64/project64.d.ts.map +1 -1
- package/typed/fp64/project64.glsl.d.ts +1 -1
- package/typed/fp64/project64.glsl.d.ts.map +1 -1
- package/typed/index.d.ts +6 -0
- package/typed/index.d.ts.map +1 -1
- package/typed/mask/mask.d.ts +21 -9
- package/typed/mask/mask.d.ts.map +1 -1
- package/typed/mask/shader-module.d.ts +6 -20
- package/typed/mask/shader-module.d.ts.map +1 -1
- package/typed/path-style/path-style.d.ts +63 -27
- package/typed/path-style/path-style.d.ts.map +1 -1
- package/typed/path-style/shaders.glsl.d.ts +6 -7
- package/typed/path-style/shaders.glsl.d.ts.map +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {project} from '@deck.gl/core';
|
|
2
|
+
import type {_ShaderModule as ShaderModule} from '@deck.gl/core';
|
|
3
|
+
import type {Texture2D} from '@luma.gl/webgl';
|
|
2
4
|
|
|
3
5
|
const vs = `
|
|
4
6
|
uniform vec4 mask_bounds;
|
|
@@ -60,12 +62,18 @@ varying vec2 mask_texCoords;
|
|
|
60
62
|
`
|
|
61
63
|
};
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
type MaskModuleSettings = {
|
|
66
|
+
maskMap?: Texture2D;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/* eslint-disable camelcase */
|
|
70
|
+
const getMaskUniforms = (opts?: MaskModuleSettings | {}): Record<string, any> => {
|
|
71
|
+
if (opts && 'maskMap' in opts) {
|
|
72
|
+
return {
|
|
73
|
+
mask_texture: opts.maskMap
|
|
74
|
+
};
|
|
67
75
|
}
|
|
68
|
-
return
|
|
76
|
+
return {};
|
|
69
77
|
};
|
|
70
78
|
|
|
71
79
|
export default {
|
|
@@ -75,4 +83,4 @@ export default {
|
|
|
75
83
|
fs,
|
|
76
84
|
inject,
|
|
77
85
|
getUniforms: getMaskUniforms
|
|
78
|
-
}
|
|
86
|
+
} as ShaderModule<MaskModuleSettings>;
|
|
@@ -22,6 +22,8 @@ import {LayerExtension, _mergeShaders as mergeShaders} from '@deck.gl/core';
|
|
|
22
22
|
import {dashShaders, offsetShaders} from './shaders.glsl';
|
|
23
23
|
import {dist} from 'gl-matrix/vec3';
|
|
24
24
|
|
|
25
|
+
import type {Layer, LayerContext, Accessor, UpdateParameters} from '@deck.gl/core';
|
|
26
|
+
|
|
25
27
|
const defaultProps = {
|
|
26
28
|
getDashArray: {type: 'accessor', value: [0, 0]},
|
|
27
29
|
getOffset: {type: 'accessor', value: 0},
|
|
@@ -29,16 +31,66 @@ const defaultProps = {
|
|
|
29
31
|
dashGapPickable: false
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
+
export type PathStyleExtensionProps<DataT = any> = {
|
|
35
|
+
/**
|
|
36
|
+
* Accessor for the dash array to draw each path with: `[dashSize, gapSize]` relative to the width of the path.
|
|
37
|
+
* Requires the `dash` option to be on.
|
|
38
|
+
*/
|
|
39
|
+
getDashArray?: Accessor<DataT, [number, number]>;
|
|
40
|
+
/**
|
|
41
|
+
* Accessor for the offset to draw each path with, relative to the width of the path.
|
|
42
|
+
* Negative offset is to the left hand side, and positive offset is to the right hand side.
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
getOffset?: Accessor<DataT, number>;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, adjust gaps for the dashes to align at both ends.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
dashJustified?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, gaps between solid strokes are pickable. If `false`, only the solid strokes are pickable.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
dashGapPickable?: boolean;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type PathStyleExtensionOptions = {
|
|
59
|
+
/**
|
|
60
|
+
* Add capability to render dashed lines.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
dash: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Add capability to offset lines.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
offset: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Improve dash rendering quality in certain circumstances. Note that this option introduces additional performance overhead.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
highPrecisionDash: boolean;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** Adds selected features to the `PathLayer` and composite layers that render the `PathLayer`. */
|
|
77
|
+
export default class PathStyleExtension extends LayerExtension<PathStyleExtensionOptions> {
|
|
78
|
+
static defaultProps = defaultProps;
|
|
79
|
+
static extensionName = 'PathStyleExtension';
|
|
80
|
+
|
|
81
|
+
constructor({
|
|
82
|
+
dash = false,
|
|
83
|
+
offset = false,
|
|
84
|
+
highPrecisionDash = false
|
|
85
|
+
}: Partial<PathStyleExtensionOptions> = {}) {
|
|
34
86
|
super({dash: dash || highPrecisionDash, offset, highPrecisionDash});
|
|
35
87
|
}
|
|
36
88
|
|
|
37
|
-
isEnabled(layer) {
|
|
38
|
-
return layer.state
|
|
89
|
+
isEnabled(layer: Layer<PathStyleExtensionProps>): boolean {
|
|
90
|
+
return 'pathTesselator' in layer.state;
|
|
39
91
|
}
|
|
40
92
|
|
|
41
|
-
getShaders(extension) {
|
|
93
|
+
getShaders(this: Layer<PathStyleExtensionProps>, extension: this): any {
|
|
42
94
|
if (!extension.isEnabled(this)) {
|
|
43
95
|
return null;
|
|
44
96
|
}
|
|
@@ -55,15 +107,13 @@ export default class PathStyleExtension extends LayerExtension {
|
|
|
55
107
|
return result;
|
|
56
108
|
}
|
|
57
109
|
|
|
58
|
-
initializeState(context, extension) {
|
|
110
|
+
initializeState(this: Layer<PathStyleExtensionProps>, context: LayerContext, extension: this) {
|
|
59
111
|
const attributeManager = this.getAttributeManager();
|
|
60
112
|
if (!attributeManager || !extension.isEnabled(this)) {
|
|
61
113
|
// This extension only works with the PathLayer
|
|
62
114
|
return;
|
|
63
115
|
}
|
|
64
116
|
|
|
65
|
-
extension.enabled = true;
|
|
66
|
-
|
|
67
117
|
if (extension.opts.dash) {
|
|
68
118
|
attributeManager.addInstanced({
|
|
69
119
|
instanceDashArrays: {size: 2, accessor: 'getDashArray'}
|
|
@@ -85,12 +135,16 @@ export default class PathStyleExtension extends LayerExtension {
|
|
|
85
135
|
}
|
|
86
136
|
}
|
|
87
137
|
|
|
88
|
-
updateState(
|
|
138
|
+
updateState(
|
|
139
|
+
this: Layer<PathStyleExtensionProps>,
|
|
140
|
+
params: UpdateParameters<Layer<PathStyleExtensionProps>>,
|
|
141
|
+
extension: this
|
|
142
|
+
) {
|
|
89
143
|
if (!extension.isEnabled(this)) {
|
|
90
144
|
return;
|
|
91
145
|
}
|
|
92
146
|
|
|
93
|
-
const uniforms = {};
|
|
147
|
+
const uniforms: any = {};
|
|
94
148
|
|
|
95
149
|
if (extension.opts.dash) {
|
|
96
150
|
uniforms.dashAlignMode = this.props.dashJustified ? 1 : 0;
|
|
@@ -100,7 +154,7 @@ export default class PathStyleExtension extends LayerExtension {
|
|
|
100
154
|
this.state.model.setUniforms(uniforms);
|
|
101
155
|
}
|
|
102
156
|
|
|
103
|
-
getDashOffsets(path) {
|
|
157
|
+
getDashOffsets(this: Layer<PathStyleExtensionProps>, path: number[] | number[][]): number[] {
|
|
104
158
|
const result = [0];
|
|
105
159
|
const positionSize = this.props.positionFormat === 'XY' ? 2 : 3;
|
|
106
160
|
const isNested = Array.isArray(path[0]);
|
|
@@ -121,6 +175,3 @@ export default class PathStyleExtension extends LayerExtension {
|
|
|
121
175
|
return result;
|
|
122
176
|
}
|
|
123
177
|
}
|
|
124
|
-
|
|
125
|
-
PathStyleExtension.extensionName = 'PathStyleExtension';
|
|
126
|
-
PathStyleExtension.defaultProps = defaultProps;
|
|
File without changes
|
|
@@ -1,19 +1,40 @@
|
|
|
1
|
-
declare class BrushingExtension extends LayerExtension {
|
|
2
|
-
useConstantTargetPositions(attribute: any): void;
|
|
3
|
-
}
|
|
4
|
-
declare namespace BrushingExtension {
|
|
5
|
-
export const extensionName: string;
|
|
6
|
-
export { defaultProps };
|
|
7
|
-
}
|
|
8
|
-
export default BrushingExtension;
|
|
9
1
|
import { LayerExtension } from '@deck.gl/core/typed';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import type { Layer, LayerContext, Accessor } from '@deck.gl/core/typed';
|
|
3
|
+
export declare type BrushingExtensionProps<DataT = any> = {
|
|
4
|
+
/**
|
|
5
|
+
* Called to retrieve an arbitrary position for each object that it will be filtered by.
|
|
6
|
+
* Only effective if `brushingTarget` is set to `custom`.
|
|
7
|
+
*/
|
|
8
|
+
getBrushingTarget?: Accessor<DataT, [number, number]>;
|
|
9
|
+
/**
|
|
10
|
+
* Enable/disable brushing. If brushing is disabled, all objects are rendered.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
brushingEnabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The position used to filter each object by.
|
|
16
|
+
*/
|
|
17
|
+
brushingTarget?: 'source' | 'target' | 'source_target' | 'custom';
|
|
18
|
+
/** The brushing radius centered at the pointer, in meters. If a data object is within this circle, it is rendered; otherwise it is hidden.
|
|
19
|
+
* @default 10000
|
|
20
|
+
*/
|
|
21
|
+
brushingRadius?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Adds GPU-based data brushing functionalities to layers. It allows the layer to show/hide objects based on the current pointer position. */
|
|
24
|
+
export default class BrushingExtension extends LayerExtension {
|
|
25
|
+
static defaultProps: {
|
|
26
|
+
getBrushingTarget: {
|
|
27
|
+
type: string;
|
|
28
|
+
value: number[];
|
|
29
|
+
};
|
|
30
|
+
brushingTarget: string;
|
|
31
|
+
brushingEnabled: boolean;
|
|
32
|
+
brushingRadius: number;
|
|
33
|
+
};
|
|
34
|
+
static extensionName: string;
|
|
35
|
+
getShaders(): any;
|
|
36
|
+
initializeState(this: Layer<BrushingExtensionProps>, context: LayerContext, extension: this): void;
|
|
37
|
+
finalizeState(this: Layer<BrushingExtensionProps>, context: LayerContext, extension: this): void;
|
|
38
|
+
useConstantTargetPositions(attribute: any): void;
|
|
18
39
|
}
|
|
19
40
|
//# sourceMappingURL=brushing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brushing.d.ts","sourceRoot":"","sources":["../../src/brushing/brushing.
|
|
1
|
+
{"version":3,"file":"brushing.d.ts","sourceRoot":"","sources":["../../src/brushing/brushing.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAG7C,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAUjE,oBAAY,sBAAsB,CAAC,KAAK,GAAG,GAAG,IAAI;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,eAAe,GAAG,QAAQ,CAAC;IAClE;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,8IAA8I;AAC9I,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,MAAM,CAAC,YAAY;;;;;;;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAuB;IAE3C,UAAU,IAAI,GAAG;IAMjB,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IAsC3F,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IAWzF,0BAA0B,CAAC,SAAS,KAAA;CAKrC"}
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
brushing_enabled?: undefined;
|
|
9
|
-
brushing_radius?: undefined;
|
|
10
|
-
brushing_target?: undefined;
|
|
11
|
-
brushing_mousePos?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
brushing_enabled: boolean;
|
|
14
|
-
brushing_radius: any;
|
|
15
|
-
brushing_target: any;
|
|
16
|
-
brushing_mousePos: any;
|
|
1
|
+
import type { Viewport, _ShaderModule as ShaderModule } from '@deck.gl/core/typed';
|
|
2
|
+
import type { BrushingExtensionProps } from './brushing';
|
|
3
|
+
declare type BrushingModuleSettings = {
|
|
4
|
+
viewport: Viewport;
|
|
5
|
+
mousePosition?: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
17
8
|
};
|
|
18
|
-
}
|
|
9
|
+
} & BrushingExtensionProps;
|
|
10
|
+
declare const _default: ShaderModule<BrushingModuleSettings>;
|
|
19
11
|
export default _default;
|
|
20
|
-
import { project } from '@deck.gl/core/typed';
|
|
21
|
-
declare const vs: "\n uniform bool brushing_enabled;\n uniform int brushing_target;\n uniform vec2 brushing_mousePos;\n uniform float brushing_radius;\n\n #ifdef NON_INSTANCED_MODEL\n attribute vec2 brushingTargets;\n #else\n attribute vec2 instanceBrushingTargets;\n #endif\n\n varying float brushing_isVisible;\n\n bool brushing_isPointInRange(vec2 position) {\n if (!brushing_enabled) {\n return true;\n }\n vec2 source_commonspace = project_position(position);\n vec2 target_commonspace = project_position(brushing_mousePos);\n float distance = length((target_commonspace - source_commonspace) / project_uCommonUnitsPerMeter.xy);\n\n return distance <= brushing_radius;\n }\n\n bool brushing_arePointsInRange(vec2 sourcePos, vec2 targetPos) {\n return brushing_isPointInRange(sourcePos) || brushing_isPointInRange(targetPos);\n }\n\n void brushing_setVisible(bool visible) {\n brushing_isVisible = float(visible);\n }\n";
|
|
22
|
-
declare const fs: "\n uniform bool brushing_enabled;\n varying float brushing_isVisible;\n";
|
|
23
|
-
declare const inject: {
|
|
24
|
-
'vs:DECKGL_FILTER_GL_POSITION': string;
|
|
25
|
-
'fs:DECKGL_FILTER_COLOR': string;
|
|
26
|
-
};
|
|
27
12
|
//# sourceMappingURL=shader-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/brushing/shader-module.
|
|
1
|
+
{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/brushing/shader-module.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,QAAQ,EAAE,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,YAAY,CAAC;AAEvD,aAAK,sBAAsB,GAAG;IAE5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CACxC,GAAG,sBAAsB,CAAC;;AAkF3B,wBA4B0C"}
|
package/typed/clip/clip.d.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
}
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { LayerExtension, _ShaderModule as ShaderModule } from '@deck.gl/core/typed';
|
|
2
|
+
import type { Layer } from '@deck.gl/core/typed';
|
|
3
|
+
export declare type ClipExtensionProps = {
|
|
4
|
+
/** Rectangular bounds to be used for clipping the rendered region, in `[left, bottom, right, top]`.
|
|
5
|
+
* @default [0, 0, 1, 1]
|
|
6
|
+
*/
|
|
7
|
+
clipBounds?: [number, number, number, number];
|
|
8
|
+
/**
|
|
9
|
+
* Controls whether an object is clipped by its anchor (e.g. icon, point) or by its geometry (e.g. path, polygon).
|
|
10
|
+
* If not specified, it is automatically deduced from the layer.
|
|
11
|
+
*/
|
|
12
|
+
clipByInstance?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Adds support for clipping rendered layers by rectangular bounds. */
|
|
15
|
+
export default class ClipExtension extends LayerExtension {
|
|
16
|
+
static defaultProps: any;
|
|
17
|
+
static extensionName: string;
|
|
18
|
+
getShaders(this: Layer<ClipExtensionProps>): {
|
|
19
|
+
modules: ShaderModule<any>[];
|
|
20
|
+
inject: {
|
|
21
|
+
'vs:#decl': string;
|
|
22
|
+
'vs:DECKGL_FILTER_GL_POSITION': string;
|
|
23
|
+
'fs:#decl': string;
|
|
24
|
+
'fs:DECKGL_FILTER_COLOR': string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
draw(this: Layer<ClipExtensionProps>, { uniforms }: any): void;
|
|
11
28
|
}
|
|
12
29
|
//# sourceMappingURL=clip.d.ts.map
|
package/typed/clip/clip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/clip/clip.
|
|
1
|
+
{"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/clip/clip.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAE,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAMzC,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AA0DF,uEAAuE;AACvE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,cAAc;IACvD,MAAM,CAAC,YAAY,EAAE,GAAG,CAAgB;IACxC,MAAM,CAAC,aAAa,SAAmB;IAEvC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC;;;;;;;;;IAyB1C,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAC,QAAQ,EAAC,EAAE,GAAG,GAAG,IAAI;CAgB7D"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export function
|
|
3
|
-
export function
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Model, Framebuffer } from '@luma.gl/core';
|
|
2
|
+
export declare function supportsFloatTarget(gl: WebGLRenderingContext): boolean;
|
|
3
|
+
export declare function getFramebuffer(gl: WebGLRenderingContext, useFloatTarget: boolean): Framebuffer;
|
|
4
|
+
export declare function getModel(gl: WebGLRenderingContext, shaderOptions: any, useFloatTarget: boolean): Model;
|
|
5
|
+
export declare const parameters: {
|
|
6
|
+
blend: boolean;
|
|
7
|
+
blendFunc: number[];
|
|
8
|
+
blendEquation: number[];
|
|
9
|
+
depthTest: boolean;
|
|
10
|
+
};
|
|
10
11
|
//# sourceMappingURL=aggregator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../src/data-filter/aggregator.
|
|
1
|
+
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../src/data-filter/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAa,WAAW,EAAW,MAAM,eAAe,CAAC;AAkDtE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAStE;AAGD,wBAAgB,cAAc,CAAC,EAAE,EAAE,qBAAqB,EAAE,cAAc,EAAE,OAAO,GAAG,WAAW,CAmB9F;AAGD,wBAAgB,QAAQ,CACtB,EAAE,EAAE,qBAAqB,EACzB,aAAa,EAAE,GAAG,EAClB,cAAc,EAAE,OAAO,GACtB,KAAK,CAeP;AAED,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"}
|
|
@@ -1,32 +1,90 @@
|
|
|
1
|
-
declare class DataFilterExtension extends LayerExtension {
|
|
2
|
-
constructor({ filterSize, fp64, countItems }?: {
|
|
3
|
-
filterSize?: number | undefined;
|
|
4
|
-
fp64?: boolean | undefined;
|
|
5
|
-
countItems?: boolean | undefined;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
declare namespace DataFilterExtension {
|
|
9
|
-
export const extensionName: string;
|
|
10
|
-
export { defaultProps };
|
|
11
|
-
}
|
|
12
|
-
export default DataFilterExtension;
|
|
13
1
|
import { LayerExtension } from '@deck.gl/core/typed';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
import type { Layer, LayerContext, Accessor, UpdateParameters } from '@deck.gl/core/typed';
|
|
3
|
+
export declare type DataFilterExtensionProps<DataT = any> = {
|
|
4
|
+
/**
|
|
5
|
+
* Accessor to retrieve the value for each object that it will be filtered by.
|
|
6
|
+
* Returns either a number (if `filterSize: 1`) or an array of numbers.
|
|
7
|
+
*/
|
|
8
|
+
getFilterValue?: Accessor<DataT, number | number[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Enable/disable the data filter. If the data filter is disabled, all objects are rendered.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
filterEnabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The [min, max] bounds which defines whether an object should be rendered.
|
|
16
|
+
* If an object's filtered value is within the bounds, the object will be rendered; otherwise it will be hidden.
|
|
17
|
+
* @default [-1, 1]
|
|
18
|
+
*/
|
|
19
|
+
filterRange?: [number, number] | [number, number][];
|
|
20
|
+
/**
|
|
21
|
+
* If specified, objects will be faded in/out instead of abruptly shown/hidden.
|
|
22
|
+
* When the filtered value is outside of the bounds defined by `filterSoftRange` but still within the bounds defined by `filterRange`, the object will be rendered as "faded."
|
|
23
|
+
* @default null
|
|
24
|
+
*/
|
|
25
|
+
filterSoftRange?: [number, number] | [number, number][] | null;
|
|
26
|
+
/**
|
|
27
|
+
* When an object is "faded", manipulate its size so that it appears smaller or thinner. Only works if `filterSoftRange` is specified.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
filterTransformSize?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When an object is "faded", manipulate its opacity so that it appears more translucent. Only works if `filterSoftRange` is specified.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
filterTransformColor?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Only called if the `countItems` option is enabled.
|
|
38
|
+
*/
|
|
39
|
+
onFilteredItemsChange?: (evt: {
|
|
40
|
+
/** The id of the source layer. */
|
|
41
|
+
id: string;
|
|
42
|
+
/** The number of data objects that pass the filter. */
|
|
43
|
+
count: number;
|
|
44
|
+
}) => void;
|
|
45
|
+
};
|
|
46
|
+
declare type DataFilterExtensionOptions = {
|
|
47
|
+
/**
|
|
48
|
+
* The size of the filter (number of columns to filter by). The data filter can show/hide data based on 1-4 numeric properties of each object.
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
filterSize: number;
|
|
52
|
+
/**
|
|
53
|
+
* Use 64-bit precision instead of 32-bit.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
fp64: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* If `true`, reports the number of filtered objects with the `onFilteredItemsChange` callback.
|
|
59
|
+
* @default `false`.
|
|
60
|
+
*/
|
|
61
|
+
countItems: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** Adds GPU-based data filtering functionalities to layers. It allows the layer to show/hide objects based on user-defined properties. */
|
|
64
|
+
export default class DataFilterExtension extends LayerExtension<DataFilterExtensionOptions> {
|
|
65
|
+
static defaultProps: {
|
|
66
|
+
getFilterValue: {
|
|
67
|
+
type: string;
|
|
68
|
+
value: number;
|
|
69
|
+
};
|
|
70
|
+
onFilteredItemsChange: {
|
|
71
|
+
type: string;
|
|
72
|
+
value: null;
|
|
73
|
+
compare: boolean;
|
|
74
|
+
};
|
|
75
|
+
filterEnabled: boolean;
|
|
76
|
+
filterRange: number[];
|
|
77
|
+
filterSoftRange: null;
|
|
78
|
+
filterTransformSize: boolean;
|
|
79
|
+
filterTransformColor: boolean;
|
|
80
|
+
};
|
|
81
|
+
static extensionName: string;
|
|
82
|
+
constructor({ filterSize, fp64, countItems }?: Partial<DataFilterExtensionOptions>);
|
|
83
|
+
getShaders(this: Layer<DataFilterExtensionProps>, extension: this): any;
|
|
84
|
+
initializeState(this: Layer<DataFilterExtensionProps>, context: LayerContext, extension: this): void;
|
|
85
|
+
updateState(this: Layer<DataFilterExtensionProps>, { props, oldProps }: UpdateParameters<Layer<DataFilterExtensionProps>>): void;
|
|
86
|
+
draw(this: Layer<DataFilterExtensionProps>, params: any, extension: this): void;
|
|
87
|
+
finalizeState(this: Layer<DataFilterExtensionProps>): void;
|
|
31
88
|
}
|
|
89
|
+
export {};
|
|
32
90
|
//# sourceMappingURL=data-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-filter.d.ts","sourceRoot":"","sources":["../../src/data-filter/data-filter.
|
|
1
|
+
{"version":3,"file":"data-filter.d.ts","sourceRoot":"","sources":["../../src/data-filter/data-filter.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAM7C,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAanF,oBAAY,wBAAwB,CAAC,KAAK,GAAG,GAAG,IAAI;IAClD;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACpD;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/D;;;OAGG;I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@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export namespace shaderModule64 {
|
|
9
|
-
const name_1: string;
|
|
10
|
-
export { name_1 as name };
|
|
11
|
-
export { vs };
|
|
12
|
-
export { fs };
|
|
13
|
-
export { inject };
|
|
14
|
-
export { getUniforms64 as getUniforms };
|
|
15
|
-
}
|
|
16
|
-
declare const vs: "\nuniform DATAFILTER_TYPE filter_min;\nuniform DATAFILTER_TYPE filter_softMin;\nuniform DATAFILTER_TYPE filter_softMax;\nuniform DATAFILTER_TYPE filter_max;\nuniform bool filter_useSoftMargin;\nuniform bool filter_enabled;\nuniform bool filter_transformSize;\n\n#ifdef NON_INSTANCED_MODEL\n #define DATAFILTER_ATTRIB filterValues\n #define DATAFILTER_ATTRIB_64LOW filterValues64Low\n#else\n #define DATAFILTER_ATTRIB instanceFilterValues\n #define DATAFILTER_ATTRIB_64LOW instanceFilterValues64Low\n#endif\n\nattribute DATAFILTER_TYPE DATAFILTER_ATTRIB;\n#ifdef DATAFILTER_DOUBLE\n attribute DATAFILTER_TYPE DATAFILTER_ATTRIB_64LOW;\n\n uniform DATAFILTER_TYPE filter_min64High;\n uniform DATAFILTER_TYPE filter_max64High;\n#endif\n\nvarying float dataFilter_value;\n\nfloat dataFilter_reduceValue(float value) {\n return value;\n}\nfloat dataFilter_reduceValue(vec2 value) {\n return min(value.x, value.y);\n}\nfloat dataFilter_reduceValue(vec3 value) {\n return min(min(value.x, value.y), value.z);\n}\nfloat dataFilter_reduceValue(vec4 value) {\n return min(min(value.x, value.y), min(value.z, value.w));\n}\nvoid dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFromMax) {\n if (filter_enabled) {\n if (filter_useSoftMargin) {\n dataFilter_value = dataFilter_reduceValue(\n smoothstep(filter_min, filter_softMin, valueFromMin) *\n (1.0 - smoothstep(filter_softMax, filter_max, valueFromMax))\n );\n } else {\n dataFilter_value = dataFilter_reduceValue(\n step(filter_min, valueFromMin) * step(valueFromMax, filter_max)\n );\n }\n } else {\n dataFilter_value = 1.0;\n }\n}\n";
|
|
17
|
-
declare const fs: "\nuniform bool filter_transformColor;\nvarying float dataFilter_value;\n";
|
|
18
|
-
declare const inject: {
|
|
19
|
-
'vs:#main-start': string;
|
|
20
|
-
'vs:DECKGL_FILTER_SIZE': string;
|
|
21
|
-
'fs:DECKGL_FILTER_COLOR': string;
|
|
22
|
-
};
|
|
23
|
-
declare function getUniforms(opts: any): {};
|
|
24
|
-
declare function getUniforms64(opts: any): {};
|
|
1
|
+
import { _ShaderModule as ShaderModule } from '@deck.gl/core/typed';
|
|
2
|
+
import type { DataFilterExtensionProps } from './data-filter';
|
|
3
|
+
declare type DataFilterModuleSettings = {
|
|
4
|
+
extensions: any[];
|
|
5
|
+
} & DataFilterExtensionProps;
|
|
6
|
+
export declare const shaderModule: ShaderModule<DataFilterModuleSettings>;
|
|
7
|
+
export declare const shaderModule64: ShaderModule<DataFilterModuleSettings>;
|
|
25
8
|
export {};
|
|
26
9
|
//# sourceMappingURL=shader-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/data-filter/shader-module.
|
|
1
|
+
{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/data-filter/shader-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,IAAI,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAmE5D,aAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,GAAG,EAAE,CAAC;CACnB,GAAG,wBAAwB,CAAC;AA2F7B,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,wBAAwB,CAM/D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,wBAAwB,CAMjE,CAAC"}
|
|
@@ -1,44 +1,77 @@
|
|
|
1
|
-
declare class FillStyleExtension extends LayerExtension {
|
|
2
|
-
constructor({ pattern }?: {
|
|
3
|
-
pattern?: boolean | undefined;
|
|
4
|
-
});
|
|
5
|
-
isEnabled(layer: any): any;
|
|
6
|
-
loadPatternAtlas({ fillPatternAtlas, fetch }: {
|
|
7
|
-
fillPatternAtlas: any;
|
|
8
|
-
fetch: any;
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
loadPatternMapping({ fillPatternMapping, fetch }: {
|
|
11
|
-
fillPatternMapping: any;
|
|
12
|
-
fetch: any;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
getPatternFrame(name: any): any[];
|
|
15
|
-
}
|
|
16
|
-
declare namespace FillStyleExtension {
|
|
17
|
-
export const extensionName: string;
|
|
18
|
-
export { defaultProps };
|
|
19
|
-
}
|
|
20
|
-
export default FillStyleExtension;
|
|
21
1
|
import { LayerExtension } from '@deck.gl/core/typed';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
import type { Layer, LayerContext, Accessor, AccessorFunction, Texture, UpdateParameters } from '@deck.gl/core/typed';
|
|
3
|
+
export declare type FillStyleExtensionProps<DataT = any> = {
|
|
4
|
+
/** Cheap toggle to enable/disable pattern fill. Requires the `pattern` option to be on.
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
fillPatternEnabled?: boolean;
|
|
8
|
+
/** Sprite image url or texture that packs all your patterns into one layout. */
|
|
9
|
+
fillPatternAtlas?: Texture;
|
|
10
|
+
/** Pattern names mapped to pattern definitions, or a url that points to a JSON file. */
|
|
11
|
+
fillPatternMapping?: string | Record<string, {
|
|
12
|
+
/** Left position of the pattern on the atlas */
|
|
13
|
+
x: number;
|
|
14
|
+
/** Top position of the pattern on the atlas */
|
|
15
|
+
y: number;
|
|
16
|
+
/** Width of the pattern */
|
|
17
|
+
width: number;
|
|
18
|
+
/** Height of the pattern */
|
|
19
|
+
height: number;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to treat the patterns as transparency masks.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
fillPatternMask?: boolean;
|
|
26
|
+
/** Accessor for the name of the pattern. */
|
|
27
|
+
getFillPattern?: AccessorFunction<DataT, string>;
|
|
28
|
+
/** Accessor for the scale of the pattern, relative to the original size. If the pattern is 24 x 24 pixels, scale `1` roughly yields 24 meters.
|
|
29
|
+
* @default 1
|
|
30
|
+
*/
|
|
31
|
+
getFillPatternScale?: Accessor<DataT, number>;
|
|
32
|
+
/**
|
|
33
|
+
* Accessor for the offset of the pattern, relative to the original size. Offset `[0.5, 0.5]` shifts the pattern alignment by half.
|
|
34
|
+
* @default [0, 0]
|
|
35
|
+
*/
|
|
36
|
+
getFillPatternOffset?: Accessor<DataT, [number, number]>;
|
|
37
|
+
};
|
|
38
|
+
declare type FillStyleExtensionOptions = {
|
|
39
|
+
/** If `true`, adds the ability to tile the filled area with a pattern.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
pattern: boolean;
|
|
43
|
+
};
|
|
44
|
+
/** Adds selected features to layers that render a "fill", such as the `PolygonLayer` and `ScatterplotLayer`. */
|
|
45
|
+
export default class FillStyleExtension extends LayerExtension<FillStyleExtensionOptions> {
|
|
46
|
+
static defaultProps: {
|
|
47
|
+
fillPatternEnabled: boolean;
|
|
48
|
+
fillPatternAtlas: null;
|
|
49
|
+
fillPatternMapping: null;
|
|
50
|
+
fillPatternMask: boolean;
|
|
51
|
+
getFillPattern: {
|
|
52
|
+
type: string;
|
|
53
|
+
value: (d: any) => any;
|
|
54
|
+
};
|
|
55
|
+
getFillPatternScale: {
|
|
56
|
+
type: string;
|
|
57
|
+
value: number;
|
|
58
|
+
};
|
|
59
|
+
getFillPatternOffset: {
|
|
60
|
+
type: string;
|
|
61
|
+
value: number[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
static extensionName: string;
|
|
65
|
+
constructor({ pattern }?: Partial<FillStyleExtensionOptions>);
|
|
66
|
+
isEnabled(layer: Layer<FillStyleExtensionProps>): boolean;
|
|
67
|
+
getShaders(this: Layer<FillStyleExtensionProps>, extension: this): any;
|
|
68
|
+
initializeState(this: Layer<FillStyleExtensionProps>, context: LayerContext, extension: this): void;
|
|
69
|
+
updateState(this: Layer<FillStyleExtensionProps>, { props, oldProps }: UpdateParameters<Layer<FillStyleExtensionProps>>, extension: this): void;
|
|
70
|
+
draw(this: Layer<FillStyleExtensionProps>, params: any, extension: this): void;
|
|
71
|
+
finalizeState(this: Layer<FillStyleExtensionProps>): void;
|
|
72
|
+
loadPatternAtlas(this: Layer<FillStyleExtensionProps>): Promise<void>;
|
|
73
|
+
loadPatternMapping(this: Layer<FillStyleExtensionProps>): Promise<void>;
|
|
74
|
+
getPatternFrame(this: Layer<FillStyleExtensionProps>, name: string): any[];
|
|
43
75
|
}
|
|
76
|
+
export {};
|
|
44
77
|
//# sourceMappingURL=fill-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-style.d.ts","sourceRoot":"","sources":["../../src/fill-style/fill-style.
|
|
1
|
+
{"version":3,"file":"fill-style.d.ts","sourceRoot":"","sources":["../../src/fill-style/fill-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAM7C,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAYvB,oBAAY,uBAAuB,CAAC,KAAK,GAAG,GAAG,IAAI;IACj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