@deck.gl/aggregation-layers 8.8.14 → 8.8.15

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/aggregation-layers",
3
3
  "description": "deck.gl layers that aggregate the input data into alternative representations",
4
4
  "license": "MIT",
5
- "version": "8.8.14",
5
+ "version": "8.8.15",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -40,5 +40,5 @@
40
40
  "@deck.gl/layers": "^8.0.0",
41
41
  "@luma.gl/core": "^8.0.0"
42
42
  },
43
- "gitHead": "c18590dbf2c2d24f8ae624913e981ff47ec595c6"
43
+ "gitHead": "c0b508f246014b2bd655de060066757ad8622261"
44
44
  }
@@ -0,0 +1,116 @@
1
+ import { Buffer, Texture2D } from '@luma.gl/core';
2
+ import { Accessor, AccessorFunction, AttributeManager, ChangeFlags, Color, Layer, LayerContext, LayersList, Position, UpdateParameters, DefaultProps } from '@deck.gl/core/typed';
3
+ import AggregationLayer, { AggregationLayerProps } from '../aggregation-layer';
4
+ export declare type HeatmapLayerProps<DataT = any> = _HeatmapLayerProps<DataT> & AggregationLayerProps<DataT>;
5
+ declare type _HeatmapLayerProps<DataT> = {
6
+ /**
7
+ * Radius of the circle in pixels, to which the weight of an object is distributed.
8
+ *
9
+ * @default 30
10
+ */
11
+ radiusPixels?: number;
12
+ /**
13
+ * Specified as an array of colors [color1, color2, ...].
14
+ *
15
+ * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)
16
+ */
17
+ colorRange?: Color[];
18
+ /**
19
+ * Value that is multiplied with the total weight at a pixel to obtain the final weight.
20
+ *
21
+ * @default 1
22
+ */
23
+ intensity?: number;
24
+ /**
25
+ * Ratio of the fading weight to the max weight, between `0` and `1`.
26
+ *
27
+ * For example, `0.1` affects all pixels with weight under 10% of the max.
28
+ *
29
+ * Ignored when `colorDomain` is specified.
30
+ * @default 0.05
31
+ */
32
+ threshold?: number;
33
+ /**
34
+ * Controls how weight values are mapped to the `colorRange`, as an array of two numbers [`minValue`, `maxValue`].
35
+ *
36
+ * @default null
37
+ */
38
+ colorDomain?: [number, number] | null;
39
+ /**
40
+ * Defines the type of aggregation operation
41
+ *
42
+ * V valid values are 'SUM', 'MEAN'.
43
+ *
44
+ * @default 'SUM'
45
+ */
46
+ aggregation?: 'SUM' | 'MEAN';
47
+ /**
48
+ * Specifies the size of weight texture.
49
+ * @default 2048
50
+ */
51
+ weightsTextureSize?: number;
52
+ /**
53
+ * Interval in milliseconds during which changes to the viewport don't trigger aggregation.
54
+ *
55
+ * @default 500
56
+ */
57
+ debounceTimeout?: number;
58
+ /**
59
+ * Method called to retrieve the position of each object.
60
+ *
61
+ * @default d => d.position
62
+ */
63
+ getPosition?: AccessorFunction<DataT, Position>;
64
+ /**
65
+ * The weight of each object.
66
+ *
67
+ * @default 1
68
+ */
69
+ getWeight?: Accessor<DataT, number>;
70
+ };
71
+ export default class HeatmapLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<ExtraPropsT & Required<_HeatmapLayerProps<DataT>>> {
72
+ static layerName: string;
73
+ static defaultProps: DefaultProps<HeatmapLayerProps<any>>;
74
+ state: AggregationLayer['state'] & {
75
+ supported: boolean;
76
+ colorDomain?: number[];
77
+ isWeightMapDirty?: boolean;
78
+ weightsTexture?: Texture2D;
79
+ zoom?: number;
80
+ worldBounds?: number[];
81
+ normalizedCommonBounds?: number[];
82
+ updateTimer?: any;
83
+ triPositionBuffer?: Buffer;
84
+ triTexCoordBuffer?: Buffer;
85
+ };
86
+ initializeState(): void;
87
+ shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
88
+ updateState(opts: UpdateParameters<this>): void;
89
+ _updateHeatmapState(opts: UpdateParameters<this>): void;
90
+ renderLayers(): LayersList | Layer;
91
+ finalizeState(context: LayerContext): void;
92
+ _getAttributeManager(): AttributeManager;
93
+ _getChangeFlags(opts: UpdateParameters<this>): Partial<ChangeFlags> & {
94
+ boundsChanged?: boolean | undefined;
95
+ viewportZoomChanged?: boolean | undefined;
96
+ };
97
+ _createTextures(): void;
98
+ _setupAttributes(): void;
99
+ _setupTextureParams(): void;
100
+ getShaders(type: any): any;
101
+ _createWeightsTransform(shaders?: {}): void;
102
+ _setupResources(): void;
103
+ updateShaders(shaderOptions: any): void;
104
+ _updateMaxWeightValue(): void;
105
+ _updateBounds(forceUpdate?: any): boolean;
106
+ _updateTextureRenderingBounds(): void;
107
+ _updateColorTexture(opts: any): void;
108
+ _updateWeightmap(): void;
109
+ _debouncedUpdateWeightmap(fromTimer?: boolean): void;
110
+ _worldToCommonBounds(worldBounds: any, opts?: {
111
+ useLayerCoordinateSystem?: boolean;
112
+ }): number[];
113
+ _commonToWorldBounds(commonBounds: any): number[];
114
+ }
115
+ export {};
116
+ //# sourceMappingURL=heatmap-layer.orig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heatmap-layer.orig.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.orig.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAC,MAAM,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AACjG,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAsD7E,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,aAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH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,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF,eAAe;IAcf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAMvD,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAQxC,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8BhD,YAAY,IAAI,UAAU,GAAG,KAAK;IA2ClC,aAAa,CAAC,OAAO,EAAE,YAAY;IA2BnC,oBAAoB;IAOpB,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;;IAsB5C,eAAe;IAgBf,gBAAgB;IAShB,mBAAmB;IAgBnB,UAAU,CAAC,IAAI,KAAA;IAcf,uBAAuB,CAAC,OAAO,KAAK;IAgBpC,eAAe;IAqCf,aAAa,CAAC,aAAa,KAAA;IAK3B,qBAAqB;IAarB,aAAa,CAAC,WAAW,GAAE,GAAW,GAAG,OAAO;IAkDhD,6BAA6B;IAe7B,mBAAmB,CAAC,IAAI,KAAA;IAqBxB,gBAAgB;IAsDhB,yBAAyB,CAAC,SAAS,UAAQ;IAsB3C,oBAAoB,CAAC,WAAW,KAAA,EAAE,IAAI,GAAE;QAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;KAAM;IA0CjF,oBAAoB,CAAC,YAAY,KAAA;CAQlC"}
@@ -0,0 +1,116 @@
1
+ import { Buffer, Texture2D } from '@luma.gl/core';
2
+ import { Accessor, AccessorFunction, AttributeManager, ChangeFlags, Color, Layer, LayerContext, LayersList, Position, UpdateParameters, DefaultProps } from '@deck.gl/core/typed';
3
+ import AggregationLayer, { AggregationLayerProps } from '../aggregation-layer';
4
+ export declare type HeatmapLayerProps<DataT = any> = _HeatmapLayerProps<DataT> & AggregationLayerProps<DataT>;
5
+ declare type _HeatmapLayerProps<DataT> = {
6
+ /**
7
+ * Radius of the circle in pixels, to which the weight of an object is distributed.
8
+ *
9
+ * @default 30
10
+ */
11
+ radiusPixels?: number;
12
+ /**
13
+ * Specified as an array of colors [color1, color2, ...].
14
+ *
15
+ * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)
16
+ */
17
+ colorRange?: Color[];
18
+ /**
19
+ * Value that is multiplied with the total weight at a pixel to obtain the final weight.
20
+ *
21
+ * @default 1
22
+ */
23
+ intensity?: number;
24
+ /**
25
+ * Ratio of the fading weight to the max weight, between `0` and `1`.
26
+ *
27
+ * For example, `0.1` affects all pixels with weight under 10% of the max.
28
+ *
29
+ * Ignored when `colorDomain` is specified.
30
+ * @default 0.05
31
+ */
32
+ threshold?: number;
33
+ /**
34
+ * Controls how weight values are mapped to the `colorRange`, as an array of two numbers [`minValue`, `maxValue`].
35
+ *
36
+ * @default null
37
+ */
38
+ colorDomain?: [number, number] | null;
39
+ /**
40
+ * Defines the type of aggregation operation
41
+ *
42
+ * V valid values are 'SUM', 'MEAN'.
43
+ *
44
+ * @default 'SUM'
45
+ */
46
+ aggregation?: 'SUM' | 'MEAN';
47
+ /**
48
+ * Specifies the size of weight texture.
49
+ * @default 2048
50
+ */
51
+ weightsTextureSize?: number;
52
+ /**
53
+ * Interval in milliseconds during which changes to the viewport don't trigger aggregation.
54
+ *
55
+ * @default 500
56
+ */
57
+ debounceTimeout?: number;
58
+ /**
59
+ * Method called to retrieve the position of each object.
60
+ *
61
+ * @default d => d.position
62
+ */
63
+ getPosition?: AccessorFunction<DataT, Position>;
64
+ /**
65
+ * The weight of each object.
66
+ *
67
+ * @default 1
68
+ */
69
+ getWeight?: Accessor<DataT, number>;
70
+ };
71
+ export default class HeatmapLayer<DataT = any, ExtraPropsT = {}> extends AggregationLayer<ExtraPropsT & Required<_HeatmapLayerProps<DataT>>> {
72
+ static layerName: string;
73
+ static defaultProps: DefaultProps<HeatmapLayerProps<any>>;
74
+ state: AggregationLayer['state'] & {
75
+ supported: boolean;
76
+ colorDomain?: number[];
77
+ isWeightMapDirty?: boolean;
78
+ weightsTexture?: Texture2D;
79
+ zoom?: number;
80
+ worldBounds?: number[];
81
+ normalizedCommonBounds?: number[];
82
+ updateTimer?: any;
83
+ triPositionBuffer?: Buffer;
84
+ triTexCoordBuffer?: Buffer;
85
+ };
86
+ initializeState(): void;
87
+ shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
88
+ updateState(opts: UpdateParameters<this>): void;
89
+ _updateHeatmapState(opts: UpdateParameters<this>): void;
90
+ renderLayers(): LayersList | Layer;
91
+ finalizeState(context: LayerContext): void;
92
+ _getAttributeManager(): AttributeManager;
93
+ _getChangeFlags(opts: UpdateParameters<this>): Partial<ChangeFlags> & {
94
+ boundsChanged?: boolean | undefined;
95
+ viewportZoomChanged?: boolean | undefined;
96
+ };
97
+ _createTextures(): void;
98
+ _setupAttributes(): void;
99
+ _setupTextureParams(): void;
100
+ getShaders(type: any): any;
101
+ _createWeightsTransform(shaders?: {}): void;
102
+ _setupResources(): void;
103
+ updateShaders(shaderOptions: any): void;
104
+ _updateMaxWeightValue(): void;
105
+ _updateBounds(forceUpdate?: any): boolean;
106
+ _updateTextureRenderingBounds(): void;
107
+ _updateColorTexture(opts: any): void;
108
+ _updateWeightmap(): void;
109
+ _debouncedUpdateWeightmap(fromTimer?: boolean): void;
110
+ _worldToCommonBounds(worldBounds: any, opts?: {
111
+ useLayerCoordinateSystem?: boolean;
112
+ }): number[];
113
+ _commonToWorldBounds(commonBounds: any): number[];
114
+ }
115
+ export {};
116
+ //# sourceMappingURL=heatmap-layer.patched.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heatmap-layer.patched.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.patched.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,MAAM,EACN,SAAS,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU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