@carto/api-client 0.5.6-alpha.bundle.4 → 0.5.7-alpha.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.
- package/CHANGELOG.md +7 -0
- package/build/api-client.cjs +29 -18
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +15 -2
- package/build/api-client.d.ts +15 -2
- package/build/api-client.js +28 -18
- 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/types.ts +2 -0
- package/src/widget-sources/widget-remote-source.ts +7 -6
- package/src/widget-sources/widget-tileset-source-impl.ts +7 -6
package/build/api-client.d.cts
CHANGED
|
@@ -72,6 +72,17 @@ declare const SpatialIndexColumn: Readonly<{
|
|
|
72
72
|
h3: string[];
|
|
73
73
|
quadbin: string[];
|
|
74
74
|
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Enum like container for all types of aggregations available for widgets.
|
|
77
|
+
*/
|
|
78
|
+
declare const AggregationTypes: {
|
|
79
|
+
readonly Count: "count";
|
|
80
|
+
readonly Avg: "avg";
|
|
81
|
+
readonly Min: "min";
|
|
82
|
+
readonly Max: "max";
|
|
83
|
+
readonly Sum: "sum";
|
|
84
|
+
readonly Custom: "custom";
|
|
85
|
+
};
|
|
75
86
|
|
|
76
87
|
/******************************************************************************
|
|
77
88
|
* MAP INSTANTIATION
|
|
@@ -160,7 +171,7 @@ type Raster = {
|
|
|
160
171
|
* AGGREGATION
|
|
161
172
|
*/
|
|
162
173
|
/**
|
|
163
|
-
* Enum for the different types of aggregations available for widgets.
|
|
174
|
+
* Enum type for the different types of aggregations available for widgets.
|
|
164
175
|
*
|
|
165
176
|
* @privateRemarks Source: @carto/constants
|
|
166
177
|
* @privateRemarks Converted from enum to type union, for improved declarative API.
|
|
@@ -1182,6 +1193,8 @@ interface CategoryRequestOptions extends BaseRequestOptions {
|
|
|
1182
1193
|
operationColumn?: string;
|
|
1183
1194
|
/** Local only. */
|
|
1184
1195
|
joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
|
|
1196
|
+
/** Maximum number of items to return. Backend calculates also __carto_others category. Remote only. */
|
|
1197
|
+
maxItems?: number;
|
|
1185
1198
|
}
|
|
1186
1199
|
/**
|
|
1187
1200
|
* Options for {@link WidgetRemoteSource#getFeatures}.
|
|
@@ -1892,4 +1905,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1892
1905
|
*/
|
|
1893
1906
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1894
1907
|
|
|
1895
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, 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 };
|
|
1908
|
+
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, 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 };
|
package/build/api-client.d.ts
CHANGED
|
@@ -72,6 +72,17 @@ declare const SpatialIndexColumn: Readonly<{
|
|
|
72
72
|
h3: string[];
|
|
73
73
|
quadbin: string[];
|
|
74
74
|
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Enum like container for all types of aggregations available for widgets.
|
|
77
|
+
*/
|
|
78
|
+
declare const AggregationTypes: {
|
|
79
|
+
readonly Count: "count";
|
|
80
|
+
readonly Avg: "avg";
|
|
81
|
+
readonly Min: "min";
|
|
82
|
+
readonly Max: "max";
|
|
83
|
+
readonly Sum: "sum";
|
|
84
|
+
readonly Custom: "custom";
|
|
85
|
+
};
|
|
75
86
|
|
|
76
87
|
/******************************************************************************
|
|
77
88
|
* MAP INSTANTIATION
|
|
@@ -160,7 +171,7 @@ type Raster = {
|
|
|
160
171
|
* AGGREGATION
|
|
161
172
|
*/
|
|
162
173
|
/**
|
|
163
|
-
* Enum for the different types of aggregations available for widgets.
|
|
174
|
+
* Enum type for the different types of aggregations available for widgets.
|
|
164
175
|
*
|
|
165
176
|
* @privateRemarks Source: @carto/constants
|
|
166
177
|
* @privateRemarks Converted from enum to type union, for improved declarative API.
|
|
@@ -1182,6 +1193,8 @@ interface CategoryRequestOptions extends BaseRequestOptions {
|
|
|
1182
1193
|
operationColumn?: string;
|
|
1183
1194
|
/** Local only. */
|
|
1184
1195
|
joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
|
|
1196
|
+
/** Maximum number of items to return. Backend calculates also __carto_others category. Remote only. */
|
|
1197
|
+
maxItems?: number;
|
|
1185
1198
|
}
|
|
1186
1199
|
/**
|
|
1187
1200
|
* Options for {@link WidgetRemoteSource#getFeatures}.
|
|
@@ -1892,4 +1905,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1892
1905
|
*/
|
|
1893
1906
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1894
1907
|
|
|
1895
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, 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 };
|
|
1908
|
+
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, 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 };
|
package/build/api-client.js
CHANGED
|
@@ -94,11 +94,11 @@ var FilterType = /* @__PURE__ */ ((FilterType2) => {
|
|
|
94
94
|
FilterType2["STRING_SEARCH"] = "stringSearch";
|
|
95
95
|
return FilterType2;
|
|
96
96
|
})(FilterType || {});
|
|
97
|
-
var ApiVersion = /* @__PURE__ */ ((
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return
|
|
97
|
+
var ApiVersion = /* @__PURE__ */ ((ApiVersion3) => {
|
|
98
|
+
ApiVersion3["V1"] = "v1";
|
|
99
|
+
ApiVersion3["V2"] = "v2";
|
|
100
|
+
ApiVersion3["V3"] = "v3";
|
|
101
|
+
return ApiVersion3;
|
|
102
102
|
})(ApiVersion || {});
|
|
103
103
|
var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
|
|
104
104
|
var TileFormat = /* @__PURE__ */ ((TileFormat2) => {
|
|
@@ -126,6 +126,14 @@ var SpatialIndexColumn = Object.freeze({
|
|
|
126
126
|
["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
|
|
127
127
|
["quadbin" /* QUADBIN */]: ["quadbin"]
|
|
128
128
|
});
|
|
129
|
+
var AggregationTypes = {
|
|
130
|
+
Count: "count",
|
|
131
|
+
Avg: "avg",
|
|
132
|
+
Min: "min",
|
|
133
|
+
Max: "max",
|
|
134
|
+
Sum: "sum",
|
|
135
|
+
Custom: "custom"
|
|
136
|
+
};
|
|
129
137
|
|
|
130
138
|
// src/utils/makeIntervalComplete.ts
|
|
131
139
|
function makeIntervalComplete(intervals) {
|
|
@@ -6263,8 +6271,8 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6263
6271
|
spatialFiltersMode,
|
|
6264
6272
|
...params
|
|
6265
6273
|
} = options;
|
|
6266
|
-
const { column, operation: operation2, operationColumn, operationExp } = params;
|
|
6267
|
-
if (operation2 ===
|
|
6274
|
+
const { column, operation: operation2, operationColumn, operationExp, maxItems } = params;
|
|
6275
|
+
if (operation2 === AggregationTypes.Custom) {
|
|
6268
6276
|
assert2(operationExp, "operationExp is required for custom operation");
|
|
6269
6277
|
}
|
|
6270
6278
|
return executeModel({
|
|
@@ -6278,7 +6286,8 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6278
6286
|
column,
|
|
6279
6287
|
operation: operation2,
|
|
6280
6288
|
operationExp,
|
|
6281
|
-
operationColumn: operationColumn || column
|
|
6289
|
+
operationColumn: operationColumn || column,
|
|
6290
|
+
maxItems
|
|
6282
6291
|
},
|
|
6283
6292
|
opts: { signal, headers: this.props.headers }
|
|
6284
6293
|
}).then((res) => normalizeObjectKeys(res.rows));
|
|
@@ -6323,7 +6332,7 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6323
6332
|
...params
|
|
6324
6333
|
} = options;
|
|
6325
6334
|
const { column, operation: operation2 } = params;
|
|
6326
|
-
if (operation2 ===
|
|
6335
|
+
if (operation2 === AggregationTypes.Custom) {
|
|
6327
6336
|
assert2(operationExp, "operationExp is required for custom operation");
|
|
6328
6337
|
}
|
|
6329
6338
|
return executeModel({
|
|
@@ -6335,7 +6344,7 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6335
6344
|
},
|
|
6336
6345
|
params: {
|
|
6337
6346
|
column: column ?? "*",
|
|
6338
|
-
operation: operation2 ??
|
|
6347
|
+
operation: operation2 ?? AggregationTypes.Count,
|
|
6339
6348
|
operationExp
|
|
6340
6349
|
},
|
|
6341
6350
|
opts: { signal, headers: this.props.headers }
|
|
@@ -6471,7 +6480,7 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6471
6480
|
splitByCategoryLimit,
|
|
6472
6481
|
splitByCategoryValues
|
|
6473
6482
|
} = params;
|
|
6474
|
-
if (operation2 ===
|
|
6483
|
+
if (operation2 === AggregationTypes.Custom) {
|
|
6475
6484
|
assert2(operationExp, "operationExp is required for custom operation");
|
|
6476
6485
|
}
|
|
6477
6486
|
return executeModel({
|
|
@@ -7203,7 +7212,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7203
7212
|
}
|
|
7204
7213
|
async getFormula({
|
|
7205
7214
|
column = "*",
|
|
7206
|
-
operation: operation2 =
|
|
7215
|
+
operation: operation2 = AggregationTypes.Count,
|
|
7207
7216
|
joinOperation,
|
|
7208
7217
|
filters,
|
|
7209
7218
|
filterOwner,
|
|
@@ -7214,13 +7223,13 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7214
7223
|
filters,
|
|
7215
7224
|
filterOwner
|
|
7216
7225
|
);
|
|
7217
|
-
if (filteredFeatures.length === 0 && operation2 !==
|
|
7226
|
+
if (filteredFeatures.length === 0 && operation2 !== AggregationTypes.Count) {
|
|
7218
7227
|
return { value: null };
|
|
7219
7228
|
}
|
|
7220
|
-
if (operation2 ===
|
|
7229
|
+
if (operation2 === AggregationTypes.Custom) {
|
|
7221
7230
|
throw new Error("Custom aggregation not supported for tilesets");
|
|
7222
7231
|
}
|
|
7223
|
-
if (column && column !== "*" || operation2 !==
|
|
7232
|
+
if (column && column !== "*" || operation2 !== AggregationTypes.Count) {
|
|
7224
7233
|
assertColumn(this._features, column);
|
|
7225
7234
|
}
|
|
7226
7235
|
const targetOperation = aggregationFunctions[operation2];
|
|
@@ -7229,7 +7238,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7229
7238
|
};
|
|
7230
7239
|
}
|
|
7231
7240
|
async getHistogram({
|
|
7232
|
-
operation: operation2 =
|
|
7241
|
+
operation: operation2 = AggregationTypes.Count,
|
|
7233
7242
|
ticks,
|
|
7234
7243
|
column,
|
|
7235
7244
|
joinOperation,
|
|
@@ -7256,7 +7265,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7256
7265
|
}
|
|
7257
7266
|
async getCategories({
|
|
7258
7267
|
column,
|
|
7259
|
-
operation: operation2 =
|
|
7268
|
+
operation: operation2 = AggregationTypes.Count,
|
|
7260
7269
|
operationColumn,
|
|
7261
7270
|
joinOperation,
|
|
7262
7271
|
filters,
|
|
@@ -8976,7 +8985,7 @@ function negateAccessor(accessor) {
|
|
|
8976
8985
|
function getSizeAccessor({ name }, scaleType, aggregation, range, data) {
|
|
8977
8986
|
const scale2 = scaleType ? SCALE_FUNCS[scaleType]() : identity2;
|
|
8978
8987
|
if (scaleType) {
|
|
8979
|
-
if (aggregation !==
|
|
8988
|
+
if (aggregation !== AggregationTypes.Count) {
|
|
8980
8989
|
scale2.domain(calculateDomain(data, name, scaleType));
|
|
8981
8990
|
}
|
|
8982
8991
|
scale2.range(range);
|
|
@@ -9956,6 +9965,7 @@ function _getHexagonResolution(viewport, tileSize) {
|
|
|
9956
9965
|
);
|
|
9957
9966
|
}
|
|
9958
9967
|
export {
|
|
9968
|
+
AggregationTypes,
|
|
9959
9969
|
ApiVersion,
|
|
9960
9970
|
basemap_styles_default as BASEMAP,
|
|
9961
9971
|
CartoAPIError,
|