@carto/api-client 0.5.6-alpha.bundle.4 → 0.5.6
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/CHANGELOG.md +7 -0
- package/build/api-client.cjs +26 -16
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +13 -2
- package/build/api-client.d.ts +13 -2
- package/build/api-client.js +25 -16
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js +14 -6
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js +14 -6
- package/build/worker.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +12 -0
- package/src/fetch-map/layer-map.ts +2 -1
- package/src/types.ts +1 -1
- package/src/widget-sources/widget-remote-source.ts +5 -5
- package/src/widget-sources/widget-tileset-source-impl.ts +7 -6
package/build/worker.js
CHANGED
|
@@ -90,6 +90,14 @@ var SpatialIndexColumn = Object.freeze({
|
|
|
90
90
|
["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
|
|
91
91
|
["quadbin" /* QUADBIN */]: ["quadbin"]
|
|
92
92
|
});
|
|
93
|
+
var AggregationTypes = {
|
|
94
|
+
Count: "count",
|
|
95
|
+
Avg: "avg",
|
|
96
|
+
Min: "min",
|
|
97
|
+
Max: "max",
|
|
98
|
+
Sum: "sum",
|
|
99
|
+
Custom: "custom"
|
|
100
|
+
};
|
|
93
101
|
|
|
94
102
|
// src/utils.ts
|
|
95
103
|
var FILTER_TYPES = new Set(Object.values(FilterType));
|
|
@@ -6215,7 +6223,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6215
6223
|
}
|
|
6216
6224
|
async getFormula({
|
|
6217
6225
|
column = "*",
|
|
6218
|
-
operation: operation2 =
|
|
6226
|
+
operation: operation2 = AggregationTypes.Count,
|
|
6219
6227
|
joinOperation,
|
|
6220
6228
|
filters,
|
|
6221
6229
|
filterOwner,
|
|
@@ -6226,13 +6234,13 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6226
6234
|
filters,
|
|
6227
6235
|
filterOwner
|
|
6228
6236
|
);
|
|
6229
|
-
if (filteredFeatures.length === 0 && operation2 !==
|
|
6237
|
+
if (filteredFeatures.length === 0 && operation2 !== AggregationTypes.Count) {
|
|
6230
6238
|
return { value: null };
|
|
6231
6239
|
}
|
|
6232
|
-
if (operation2 ===
|
|
6240
|
+
if (operation2 === AggregationTypes.Custom) {
|
|
6233
6241
|
throw new Error("Custom aggregation not supported for tilesets");
|
|
6234
6242
|
}
|
|
6235
|
-
if (column && column !== "*" || operation2 !==
|
|
6243
|
+
if (column && column !== "*" || operation2 !== AggregationTypes.Count) {
|
|
6236
6244
|
assertColumn(this._features, column);
|
|
6237
6245
|
}
|
|
6238
6246
|
const targetOperation = aggregationFunctions[operation2];
|
|
@@ -6241,7 +6249,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6241
6249
|
};
|
|
6242
6250
|
}
|
|
6243
6251
|
async getHistogram({
|
|
6244
|
-
operation: operation2 =
|
|
6252
|
+
operation: operation2 = AggregationTypes.Count,
|
|
6245
6253
|
ticks,
|
|
6246
6254
|
column,
|
|
6247
6255
|
joinOperation,
|
|
@@ -6268,7 +6276,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6268
6276
|
}
|
|
6269
6277
|
async getCategories({
|
|
6270
6278
|
column,
|
|
6271
|
-
operation: operation2 =
|
|
6279
|
+
operation: operation2 = AggregationTypes.Count,
|
|
6272
6280
|
operationColumn,
|
|
6273
6281
|
joinOperation,
|
|
6274
6282
|
filters,
|