@deck.gl/carto 9.0.31 → 9.0.32

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
@@ -3,7 +3,7 @@
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.0.31",
6
+ "version": "9.0.32",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -72,5 +72,5 @@
72
72
  "@deck.gl/layers": "^9.0.0",
73
73
  "@loaders.gl/core": "^4.2.0"
74
74
  },
75
- "gitHead": "278d31bf475254de96c2bdad832f5bc5d503946e"
75
+ "gitHead": "fbb23d90639ff5fc3e2942216d5edc781cb14a89"
76
76
  }
@@ -136,6 +136,13 @@ const customMarkersPropsMap = {
136
136
  }
137
137
  };
138
138
 
139
+ const heatmapTilePropsMap = {
140
+ visConfig: {
141
+ colorRange: x => ({colorRange: x.colors.map(hexToRGBA)}),
142
+ radius: 'radiusPixels'
143
+ }
144
+ };
145
+
139
146
  const aggregationVisConfig = {
140
147
  colorAggregation: x => ({colorAggregation: AGGREGATION[x] || AGGREGATION.sum}),
141
148
  colorRange: x => ({colorRange: x.colors.map(hexToRGBA)}),
@@ -164,7 +171,10 @@ export function getLayer(
164
171
  let basePropMap: any = sharedPropMap;
165
172
 
166
173
  if (config.visConfig?.customMarkers) {
167
- basePropMap = mergePropMaps(sharedPropMap, customMarkersPropsMap);
174
+ basePropMap = mergePropMaps(basePropMap, customMarkersPropsMap);
175
+ }
176
+ if (type === 'heatmapTile') {
177
+ basePropMap = mergePropMaps(basePropMap, heatmapTilePropsMap);
168
178
  }
169
179
  if (TILE_LAYER_TYPE_TO_LAYER[type]) {
170
180
  return getTileLayer(dataset, basePropMap, type);
@@ -168,7 +168,8 @@ function createChannelProps(
168
168
  sizeField,
169
169
  sizeScale,
170
170
  strokeColorField,
171
- strokeColorScale
171
+ strokeColorScale,
172
+ weightField
172
173
  } = visualChannels;
173
174
  let {heightField, heightScale} = visualChannels;
174
175
  if (type === 'hexagonId') {
@@ -242,7 +243,6 @@ function createChannelProps(
242
243
  data
243
244
  );
244
245
  }
245
-
246
246
  if (heightField && visConfig.enable3d) {
247
247
  result.getElevation = getSizeAccessor(
248
248
  heightField,
@@ -254,6 +254,16 @@ function createChannelProps(
254
254
  );
255
255
  }
256
256
 
257
+ if (weightField) {
258
+ result.getWeight = getSizeAccessor(
259
+ weightField,
260
+ undefined,
261
+ visConfig.weightAggregation,
262
+ undefined,
263
+ data
264
+ );
265
+ }
266
+
257
267
  if (visConfig.customMarkers) {
258
268
  const maxIconSize = getMaxMarkerSize(visConfig, visualChannels);
259
269
  const {getPointRadius, getFillColor} = result;
package/src/api/types.ts CHANGED
@@ -102,6 +102,8 @@ export type VisualChannels = {
102
102
 
103
103
  heightField?: VisualChannelField;
104
104
  heightScale?: SCALE_TYPE;
105
+
106
+ weightField?: VisualChannelField;
105
107
  };
106
108
 
107
109
  export type ColorRange = {
@@ -144,6 +146,8 @@ export type VisConfig = {
144
146
 
145
147
  heightRange?: any;
146
148
  heightAggregation?: any;
149
+
150
+ weightAggregation?: any;
147
151
  };
148
152
 
149
153
  export type TextLabel = {