@carto/api-client 0.5.30-alpha.3cf7d80.116 → 0.5.30-alpha.b195e7f.118

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 CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### 0.5.30
6
+
5
7
  - feat(widgetSources): support `featureIds` / `geometryType` request options to filter widget aggregations by a feature selection without relying on the synthetic `_carto_feature_id` column (#294)
8
+ - feat(widgetSources): support `SpatialIndexFilter` (H3/Quadbin cell selection) on `spatialFilter` (#296)
6
9
 
7
10
  ### 0.5.29
8
11
 
@@ -185,6 +185,7 @@ __export(src_exports, {
185
185
  h3TilesetSource: () => h3TilesetSource,
186
186
  hasFilter: () => hasFilter,
187
187
  histogram: () => histogram,
188
+ isSpatialIndexFilter: () => isSpatialIndexFilter,
188
189
  makeIntervalComplete: () => makeIntervalComplete,
189
190
  negateAccessor: () => negateAccessor,
190
191
  opacityToAlpha: () => opacityToAlpha,
@@ -5801,6 +5802,9 @@ var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
5801
5802
  SchemaFieldType2["Unknown"] = "unknown";
5802
5803
  return SchemaFieldType2;
5803
5804
  })(SchemaFieldType || {});
5805
+ function isSpatialIndexFilter(spatialFilter) {
5806
+ return Array.isArray(spatialFilter.indexes);
5807
+ }
5804
5808
 
5805
5809
  // src/utils.ts
5806
5810
  var FILTER_TYPES = new Set(Object.values(FilterType));
@@ -7685,16 +7689,17 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7685
7689
  this._features.length = 0;
7686
7690
  }
7687
7691
  _extractTileFeatures(spatialFilter) {
7692
+ const geometryFilter = spatialFilter && !isSpatialIndexFilter(spatialFilter) ? spatialFilter : void 0;
7688
7693
  const prevInputs = this._tileFeatureExtractPreviousInputs;
7689
- if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, spatialFilter)) {
7694
+ if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, geometryFilter)) {
7690
7695
  return;
7691
7696
  }
7692
7697
  this._features = tileFeatures({
7693
7698
  ...assignOptional({}, this.props, this._tileFeatureExtractOptions),
7694
7699
  tiles: this._tiles,
7695
- spatialFilter
7700
+ spatialFilter: geometryFilter
7696
7701
  });
7697
- prevInputs.spatialFilter = spatialFilter;
7702
+ prevInputs.spatialFilter = geometryFilter;
7698
7703
  }
7699
7704
  /**
7700
7705
  * Loads features as GeoJSON (used for testing).
@@ -11854,6 +11859,7 @@ function hashBuckets(initialCount) {
11854
11859
  h3TilesetSource,
11855
11860
  hasFilter,
11856
11861
  histogram,
11862
+ isSpatialIndexFilter,
11857
11863
  makeIntervalComplete,
11858
11864
  negateAccessor,
11859
11865
  opacityToAlpha,