@carto/api-client 0.5.7-alpha-optional-spatial-filter.1 → 0.5.7-alpha-others-orderby.1

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.
@@ -1165,6 +1165,7 @@ interface BaseRequestOptions {
1165
1165
  filters?: Filters;
1166
1166
  filterOwner?: string;
1167
1167
  }
1168
+ type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
1168
1169
  /**
1169
1170
  * Examples:
1170
1171
  * * population by state
@@ -1193,6 +1194,15 @@ interface CategoryRequestOptions extends BaseRequestOptions {
1193
1194
  operationColumn?: string;
1194
1195
  /** Local only. */
1195
1196
  joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
1197
+ /** Calculate `_carto_others` category for all categories after first N (N is threshold). */
1198
+ othersThreshold?: number;
1199
+ /**
1200
+ * Order categories by frequency or alphabetically.
1201
+ * @default 'frequency_desc'
1202
+ */
1203
+ orderBy?: CategoryOrderBy;
1204
+ /** Return raw result (CategoryResponseRaw). */
1205
+ rawResult?: boolean;
1196
1206
  }
1197
1207
  /**
1198
1208
  * Options for {@link WidgetRemoteSource#getFeatures}.
@@ -1327,11 +1337,19 @@ type FeaturesResponse = {
1327
1337
  type FormulaResponse = {
1328
1338
  value: number | null;
1329
1339
  };
1330
- /** Response from {@link WidgetRemoteSource#getCategories}. */
1331
- type CategoryResponse = {
1332
- name: string;
1340
+ /** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
1341
+ type CategoryResponseEntry = {
1342
+ name: string | null;
1333
1343
  value: number;
1334
- }[];
1344
+ };
1345
+ /** Response from {@link WidgetRemoteSource#getCategories}. */
1346
+ type CategoryResponse = CategoryResponseEntry[];
1347
+ type CategoryResponseRaw = {
1348
+ rows: CategoryResponseEntry[] | null;
1349
+ metadata?: {
1350
+ others?: number;
1351
+ };
1352
+ };
1335
1353
  /** Response from {@link WidgetRemoteSource#getRange}. */
1336
1354
  type RangeResponse = {
1337
1355
  min: number;
@@ -1533,7 +1551,7 @@ type TileFeatures = {
1533
1551
  tileFormat: TileFormat;
1534
1552
  spatialDataType: SpatialDataType;
1535
1553
  spatialDataColumn?: string;
1536
- spatialFilter?: SpatialFilter;
1554
+ spatialFilter: SpatialFilter;
1537
1555
  uniqueIdProperty?: string;
1538
1556
  rasterMetadata?: RasterMetadata;
1539
1557
  storeGeometry?: boolean;
@@ -1555,14 +1573,14 @@ type GeometryExtractOptions = {
1555
1573
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
1556
1574
  tiles: Tile[];
1557
1575
  tileFormat?: TileFormat;
1558
- spatialFilter?: SpatialFilter;
1576
+ spatialFilter: SpatialFilter;
1559
1577
  uniqueIdProperty?: string;
1560
1578
  options?: GeometryExtractOptions;
1561
1579
  }): FeatureData[];
1562
1580
 
1563
1581
  type TileFeaturesSpatialIndexOptions = {
1564
1582
  tiles: SpatialIndexTile[];
1565
- spatialFilter?: SpatialFilter;
1583
+ spatialFilter: SpatialFilter;
1566
1584
  spatialDataColumn: string;
1567
1585
  spatialDataType: SpatialDataType;
1568
1586
  };
@@ -1600,7 +1618,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1600
1618
  loadTiles(tiles: unknown[]): void;
1601
1619
  /** Configures options used to extract features from tiles. */
1602
1620
  setTileFeatureExtractOptions(options: TileFeatureExtractOptions): void;
1603
- protected _extractTileFeatures(spatialFilter?: SpatialFilter): void;
1621
+ protected _extractTileFeatures(spatialFilter: SpatialFilter): void;
1604
1622
  /**
1605
1623
  * Loads features as GeoJSON (used for testing).
1606
1624
  * @experimental
@@ -1613,7 +1631,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1613
1631
  getFeatures(): Promise<FeaturesResponse>;
1614
1632
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
1615
1633
  getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
1616
- getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: CategoryRequestOptions): Promise<CategoryResponse>;
1634
+ getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, orderBy, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1617
1635
  getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
1618
1636
  getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
1619
1637
  getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
@@ -1734,6 +1752,13 @@ declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptio
1734
1752
  protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1735
1753
  }
1736
1754
 
1755
+ /**
1756
+ * Name of the category that represents the "Others" category.
1757
+ *
1758
+ * See `WidgetSource.getCategories` for more information.
1759
+ */
1760
+ declare const OTHERS_CATEGORY_NAME = "_carto_others";
1761
+
1737
1762
  type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1738
1763
  type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1739
1764
  declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
@@ -1812,19 +1837,22 @@ interface SortOptions {
1812
1837
  declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
1813
1838
 
1814
1839
  /** @privateRemarks Source: @carto/react-core */
1815
- type GroupByFeature = {
1816
- name: string;
1817
- value: number;
1818
- }[];
1819
- /** @privateRemarks Source: @carto/react-core */
1820
- declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, }: {
1840
+ declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, orderBy, }: {
1821
1841
  data: FeatureData[];
1822
1842
  valuesColumns?: string[];
1823
1843
  joinOperation?: AggregationType;
1824
1844
  keysColumn: string;
1825
1845
  operation: AggregationType;
1826
- }): GroupByFeature | null;
1846
+ othersThreshold?: number;
1847
+ orderBy?: CategoryOrderBy;
1848
+ }): CategoryResponseRaw | null;
1849
+ declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
1827
1850
 
1851
+ /** @privateRemarks Source: @carto/react-core */
1852
+ type GroupByFeature = {
1853
+ name: string;
1854
+ value: number;
1855
+ }[];
1828
1856
  /** @privateRemarks Source: @carto/react-core */
1829
1857
  declare function groupValuesByDateColumn({ data, valuesColumns, joinOperation, keysColumn, groupType, operation, }: {
1830
1858
  data: Record<string, unknown>[];
@@ -1921,4 +1949,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
1921
1949
  */
1922
1950
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
1923
1951
 
1924
- export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
1952
+ export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
@@ -1165,6 +1165,7 @@ interface BaseRequestOptions {
1165
1165
  filters?: Filters;
1166
1166
  filterOwner?: string;
1167
1167
  }
1168
+ type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
1168
1169
  /**
1169
1170
  * Examples:
1170
1171
  * * population by state
@@ -1193,6 +1194,15 @@ interface CategoryRequestOptions extends BaseRequestOptions {
1193
1194
  operationColumn?: string;
1194
1195
  /** Local only. */
1195
1196
  joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
1197
+ /** Calculate `_carto_others` category for all categories after first N (N is threshold). */
1198
+ othersThreshold?: number;
1199
+ /**
1200
+ * Order categories by frequency or alphabetically.
1201
+ * @default 'frequency_desc'
1202
+ */
1203
+ orderBy?: CategoryOrderBy;
1204
+ /** Return raw result (CategoryResponseRaw). */
1205
+ rawResult?: boolean;
1196
1206
  }
1197
1207
  /**
1198
1208
  * Options for {@link WidgetRemoteSource#getFeatures}.
@@ -1327,11 +1337,19 @@ type FeaturesResponse = {
1327
1337
  type FormulaResponse = {
1328
1338
  value: number | null;
1329
1339
  };
1330
- /** Response from {@link WidgetRemoteSource#getCategories}. */
1331
- type CategoryResponse = {
1332
- name: string;
1340
+ /** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
1341
+ type CategoryResponseEntry = {
1342
+ name: string | null;
1333
1343
  value: number;
1334
- }[];
1344
+ };
1345
+ /** Response from {@link WidgetRemoteSource#getCategories}. */
1346
+ type CategoryResponse = CategoryResponseEntry[];
1347
+ type CategoryResponseRaw = {
1348
+ rows: CategoryResponseEntry[] | null;
1349
+ metadata?: {
1350
+ others?: number;
1351
+ };
1352
+ };
1335
1353
  /** Response from {@link WidgetRemoteSource#getRange}. */
1336
1354
  type RangeResponse = {
1337
1355
  min: number;
@@ -1533,7 +1551,7 @@ type TileFeatures = {
1533
1551
  tileFormat: TileFormat;
1534
1552
  spatialDataType: SpatialDataType;
1535
1553
  spatialDataColumn?: string;
1536
- spatialFilter?: SpatialFilter;
1554
+ spatialFilter: SpatialFilter;
1537
1555
  uniqueIdProperty?: string;
1538
1556
  rasterMetadata?: RasterMetadata;
1539
1557
  storeGeometry?: boolean;
@@ -1555,14 +1573,14 @@ type GeometryExtractOptions = {
1555
1573
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
1556
1574
  tiles: Tile[];
1557
1575
  tileFormat?: TileFormat;
1558
- spatialFilter?: SpatialFilter;
1576
+ spatialFilter: SpatialFilter;
1559
1577
  uniqueIdProperty?: string;
1560
1578
  options?: GeometryExtractOptions;
1561
1579
  }): FeatureData[];
1562
1580
 
1563
1581
  type TileFeaturesSpatialIndexOptions = {
1564
1582
  tiles: SpatialIndexTile[];
1565
- spatialFilter?: SpatialFilter;
1583
+ spatialFilter: SpatialFilter;
1566
1584
  spatialDataColumn: string;
1567
1585
  spatialDataType: SpatialDataType;
1568
1586
  };
@@ -1600,7 +1618,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1600
1618
  loadTiles(tiles: unknown[]): void;
1601
1619
  /** Configures options used to extract features from tiles. */
1602
1620
  setTileFeatureExtractOptions(options: TileFeatureExtractOptions): void;
1603
- protected _extractTileFeatures(spatialFilter?: SpatialFilter): void;
1621
+ protected _extractTileFeatures(spatialFilter: SpatialFilter): void;
1604
1622
  /**
1605
1623
  * Loads features as GeoJSON (used for testing).
1606
1624
  * @experimental
@@ -1613,7 +1631,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1613
1631
  getFeatures(): Promise<FeaturesResponse>;
1614
1632
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
1615
1633
  getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
1616
- getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: CategoryRequestOptions): Promise<CategoryResponse>;
1634
+ getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, orderBy, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1617
1635
  getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
1618
1636
  getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
1619
1637
  getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
@@ -1734,6 +1752,13 @@ declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptio
1734
1752
  protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1735
1753
  }
1736
1754
 
1755
+ /**
1756
+ * Name of the category that represents the "Others" category.
1757
+ *
1758
+ * See `WidgetSource.getCategories` for more information.
1759
+ */
1760
+ declare const OTHERS_CATEGORY_NAME = "_carto_others";
1761
+
1737
1762
  type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1738
1763
  type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1739
1764
  declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
@@ -1812,19 +1837,22 @@ interface SortOptions {
1812
1837
  declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
1813
1838
 
1814
1839
  /** @privateRemarks Source: @carto/react-core */
1815
- type GroupByFeature = {
1816
- name: string;
1817
- value: number;
1818
- }[];
1819
- /** @privateRemarks Source: @carto/react-core */
1820
- declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, }: {
1840
+ declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, orderBy, }: {
1821
1841
  data: FeatureData[];
1822
1842
  valuesColumns?: string[];
1823
1843
  joinOperation?: AggregationType;
1824
1844
  keysColumn: string;
1825
1845
  operation: AggregationType;
1826
- }): GroupByFeature | null;
1846
+ othersThreshold?: number;
1847
+ orderBy?: CategoryOrderBy;
1848
+ }): CategoryResponseRaw | null;
1849
+ declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
1827
1850
 
1851
+ /** @privateRemarks Source: @carto/react-core */
1852
+ type GroupByFeature = {
1853
+ name: string;
1854
+ value: number;
1855
+ }[];
1828
1856
  /** @privateRemarks Source: @carto/react-core */
1829
1857
  declare function groupValuesByDateColumn({ data, valuesColumns, joinOperation, keysColumn, groupType, operation, }: {
1830
1858
  data: Record<string, unknown>[];
@@ -1921,4 +1949,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
1921
1949
  */
1922
1950
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
1923
1951
 
1924
- export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
1952
+ export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };