@carto/api-client 0.5.0-alpha.11 → 0.5.0-alpha.13
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/build/api-client.cjs +6 -7
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +15 -5
- package/build/api-client.d.ts +15 -5
- package/build/api-client.js +6 -7
- package/build/api-client.js.map +1 -1
- package/package.json +3 -3
- package/src/deck/get-data-filter-extension-props.ts +27 -9
- package/src/widget-sources/widget-tileset-source.ts +2 -3
package/build/api-client.d.cts
CHANGED
|
@@ -225,13 +225,23 @@ type _DataFilterExtensionProps = {
|
|
|
225
225
|
};
|
|
226
226
|
/**
|
|
227
227
|
* Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
|
|
228
|
-
* a set of filters.
|
|
228
|
+
* a set of filters. Requires that DataFilterExtension is initialized with
|
|
229
|
+
* filterSize=4, where the CARTO filters will occupy the first two slots.
|
|
229
230
|
*
|
|
230
|
-
* @
|
|
231
|
-
*
|
|
232
|
-
*
|
|
231
|
+
* @example To create a deck.gl layer with GPU data filtering:
|
|
232
|
+
* ```typescript
|
|
233
|
+
* import {DataFilterExtension} from '@deck.gl/extensions';
|
|
234
|
+
* import {VectorTileLayer} from '@deck.gl/layers';
|
|
235
|
+
* import {getDataFilterExtensionProps} from '@carto/api-client';
|
|
236
|
+
*
|
|
237
|
+
* const layer = new VectorTileLayer({
|
|
238
|
+
* data: data,
|
|
239
|
+
* extensions: [new DataFilterExtension({filterSize: 4})],
|
|
240
|
+
* ...getDataFilterExtensionProps(filters),
|
|
241
|
+
* });
|
|
242
|
+
* ```
|
|
233
243
|
*/
|
|
234
|
-
declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator
|
|
244
|
+
declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
|
|
235
245
|
|
|
236
246
|
type FilterTypeOptions<T extends FilterType> = {
|
|
237
247
|
type: T;
|
package/build/api-client.d.ts
CHANGED
|
@@ -225,13 +225,23 @@ type _DataFilterExtensionProps = {
|
|
|
225
225
|
};
|
|
226
226
|
/**
|
|
227
227
|
* Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
|
|
228
|
-
* a set of filters.
|
|
228
|
+
* a set of filters. Requires that DataFilterExtension is initialized with
|
|
229
|
+
* filterSize=4, where the CARTO filters will occupy the first two slots.
|
|
229
230
|
*
|
|
230
|
-
* @
|
|
231
|
-
*
|
|
232
|
-
*
|
|
231
|
+
* @example To create a deck.gl layer with GPU data filtering:
|
|
232
|
+
* ```typescript
|
|
233
|
+
* import {DataFilterExtension} from '@deck.gl/extensions';
|
|
234
|
+
* import {VectorTileLayer} from '@deck.gl/layers';
|
|
235
|
+
* import {getDataFilterExtensionProps} from '@carto/api-client';
|
|
236
|
+
*
|
|
237
|
+
* const layer = new VectorTileLayer({
|
|
238
|
+
* data: data,
|
|
239
|
+
* extensions: [new DataFilterExtension({filterSize: 4})],
|
|
240
|
+
* ...getDataFilterExtensionProps(filters),
|
|
241
|
+
* });
|
|
242
|
+
* ```
|
|
233
243
|
*/
|
|
234
|
-
declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator
|
|
244
|
+
declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
|
|
235
245
|
|
|
236
246
|
type FilterTypeOptions<T extends FilterType> = {
|
|
237
247
|
type: T;
|
package/build/api-client.js
CHANGED
|
@@ -1241,11 +1241,11 @@ function tileFeatures({
|
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
1243
1243
|
// src/deck/get-data-filter-extension-props.ts
|
|
1244
|
-
|
|
1245
|
-
|
|
1244
|
+
var DEFAULT_FILTER_SIZE = 4;
|
|
1245
|
+
function getDataFilterExtensionProps(filters, filtersLogicalOperator) {
|
|
1246
1246
|
const { filtersWithoutTimeType, timeColumn, timeFilter } = getFiltersByType(filters);
|
|
1247
1247
|
return {
|
|
1248
|
-
filterRange: getFilterRange(timeFilter,
|
|
1248
|
+
filterRange: getFilterRange(timeFilter, DEFAULT_FILTER_SIZE),
|
|
1249
1249
|
updateTriggers: getUpdateTriggers(
|
|
1250
1250
|
filtersWithoutTimeType,
|
|
1251
1251
|
timeColumn,
|
|
@@ -1255,7 +1255,7 @@ function getDataFilterExtensionProps(filters, filtersLogicalOperator, filterSize
|
|
|
1255
1255
|
filtersWithoutTimeType,
|
|
1256
1256
|
timeColumn,
|
|
1257
1257
|
timeFilter,
|
|
1258
|
-
|
|
1258
|
+
DEFAULT_FILTER_SIZE,
|
|
1259
1259
|
filtersLogicalOperator
|
|
1260
1260
|
)
|
|
1261
1261
|
};
|
|
@@ -3143,9 +3143,8 @@ var WidgetTilesetSource = class extends WidgetSource {
|
|
|
3143
3143
|
function onMessage(e) {
|
|
3144
3144
|
const response = e.data;
|
|
3145
3145
|
if (response.requestId !== requestId) return;
|
|
3146
|
-
if (signal?.aborted)
|
|
3147
|
-
|
|
3148
|
-
} else if (response.ok) {
|
|
3146
|
+
if (signal?.aborted) return;
|
|
3147
|
+
if (response.ok) {
|
|
3149
3148
|
resolve(response.result);
|
|
3150
3149
|
} else {
|
|
3151
3150
|
reject(new Error(response.error));
|