@carto/api-client 0.5.0-alpha.6 → 0.5.0-alpha.8
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 +97 -111
- package/build/api-client.d.cts +69 -62
- package/build/api-client.d.ts +69 -62
- package/build/api-client.js +2130 -170
- package/build/worker.js +2119 -4
- package/package.json +5 -5
- package/src/models/common.ts +2 -2
- package/src/sources/h3-tileset-source.ts +1 -8
- package/src/sources/quadbin-tileset-source.ts +1 -8
- package/src/sources/vector-tileset-source.ts +1 -8
- package/src/widget-sources/index.ts +0 -1
- package/src/widget-sources/types.ts +1 -1
- package/src/widget-sources/widget-remote-source.ts +16 -16
- package/src/widget-sources/widget-source.ts +11 -0
- package/src/widget-sources/widget-tileset-source-impl.ts +417 -0
- package/src/widget-sources/widget-tileset-source.ts +192 -331
- package/src/workers/widget-tileset-worker.ts +6 -3
- package/build/chunk-LEI5PI5X.js +0 -2063
- package/src/widget-sources/widget-tileset-worker-source.ts +0 -268
- package/src/workers/utils.ts +0 -33
package/build/api-client.d.cts
CHANGED
|
@@ -681,11 +681,11 @@ interface ViewState {
|
|
|
681
681
|
}
|
|
682
682
|
/** Common options for {@link WidgetRemoteSource} requests. */
|
|
683
683
|
interface BaseRequestOptions {
|
|
684
|
+
signal?: AbortSignal;
|
|
684
685
|
spatialFilter?: SpatialFilter;
|
|
685
686
|
spatialFiltersMode?: SpatialFilterPolyfillMode;
|
|
686
687
|
/** Required for table- and query-based spatial index sources (H3, Quadbin). */
|
|
687
688
|
spatialIndexReferenceViewState?: ViewState;
|
|
688
|
-
abortController?: AbortController;
|
|
689
689
|
/** Overrides source filters, if any. */
|
|
690
690
|
filters?: Filters;
|
|
691
691
|
filterOwner?: string;
|
|
@@ -863,6 +863,14 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps> {
|
|
|
863
863
|
readonly props: Props;
|
|
864
864
|
static defaultProps: Partial<WidgetSourceProps>;
|
|
865
865
|
constructor(props: Props);
|
|
866
|
+
/**
|
|
867
|
+
* Destroys the widget source and releases allocated resources.
|
|
868
|
+
*
|
|
869
|
+
* For remote sources (tables, queries) this has no effect, but for local
|
|
870
|
+
* sources (tilesets, rasters) these resources will affect performance
|
|
871
|
+
* and stability if many (10+) sources are created and not released.
|
|
872
|
+
*/
|
|
873
|
+
destroy(): void;
|
|
866
874
|
protected _getSpatialFiltersResolution(source: Omit<ModelSource, 'type' | 'data'>, spatialFilter?: SpatialFilter, referenceViewState?: ViewState): number | undefined;
|
|
867
875
|
/**
|
|
868
876
|
* Returns a list of labeled datapoints for categorical data. Suitable for
|
|
@@ -1066,36 +1074,26 @@ type TileFeaturesSpatialIndexOptions = {
|
|
|
1066
1074
|
};
|
|
1067
1075
|
declare function tileFeaturesSpatialIndex({ tiles, spatialFilter, spatialDataColumn, spatialDataType, }: TileFeaturesSpatialIndexOptions): FeatureData[];
|
|
1068
1076
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1077
|
+
declare enum Method {
|
|
1078
|
+
INIT = "init",
|
|
1079
|
+
LOAD_TILES = "loadTiles",
|
|
1080
|
+
SET_TILE_FEATURE_EXTRACT_OPTIONS = "setTileFeatureExtractOptions",
|
|
1081
|
+
LOAD_GEOJSON = "loadGeoJSON",
|
|
1082
|
+
GET_FORMULA = "getFormula",
|
|
1083
|
+
GET_HISTOGRAM = "getHistogram",
|
|
1084
|
+
GET_CATEGORIES = "getCategories",
|
|
1085
|
+
GET_SCATTER = "getScatter",
|
|
1086
|
+
GET_TABLE = "getTable",
|
|
1087
|
+
GET_TIME_SERIES = "getTimeSeries",
|
|
1088
|
+
GET_RANGE = "getRange"
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1076
1091
|
/**
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1079
|
-
*
|
|
1080
|
-
* {@link vectorTilesetSource}, {@link h3TilesetSource}, or {@link quadbinTilesetSource},
|
|
1081
|
-
* which can be shared with map layers. Sources contain a `widgetSource`
|
|
1082
|
-
* property, for use by widget implementations.
|
|
1083
|
-
*
|
|
1084
|
-
* Example:
|
|
1085
|
-
*
|
|
1086
|
-
* ```javascript
|
|
1087
|
-
* import { vectorTilesetSource } from '@carto/api-client';
|
|
1088
|
-
*
|
|
1089
|
-
* const data = vectorTilesetSource({
|
|
1090
|
-
* accessToken: '••••',
|
|
1091
|
-
* connectionName: 'carto_dw',
|
|
1092
|
-
* tableName: 'carto-demo-data.demo_rasters.my_tileset_source'
|
|
1093
|
-
* });
|
|
1094
|
-
*
|
|
1095
|
-
* const { widgetSource } = await data;
|
|
1096
|
-
* ```
|
|
1092
|
+
* Local (in-memory) implementation of tileset widget calculations. This class
|
|
1093
|
+
* may be instantiated by {@link WidgetTilesetSource} in a Web Worker when
|
|
1094
|
+
* supported, or on the main thread.
|
|
1097
1095
|
*/
|
|
1098
|
-
declare class
|
|
1096
|
+
declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourceProps> {
|
|
1099
1097
|
private _tiles;
|
|
1100
1098
|
private _features;
|
|
1101
1099
|
private _tileFeatureExtractOptions;
|
|
@@ -1132,40 +1130,49 @@ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps>
|
|
|
1132
1130
|
private _getFilteredFeatures;
|
|
1133
1131
|
}
|
|
1134
1132
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
GET_CATEGORIES = "getCategories",
|
|
1143
|
-
GET_SCATTER = "getScatter",
|
|
1144
|
-
GET_TABLE = "getTable",
|
|
1145
|
-
GET_TIME_SERIES = "getTimeSeries",
|
|
1146
|
-
GET_RANGE = "getRange"
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1133
|
+
type WidgetTilesetSourceProps = WidgetSourceProps & Omit<TilesetSourceOptions, 'filters'> & {
|
|
1134
|
+
tileFormat: TileFormat;
|
|
1135
|
+
spatialDataType: SpatialDataType;
|
|
1136
|
+
};
|
|
1137
|
+
type WidgetTilesetSourceResult = {
|
|
1138
|
+
widgetSource: WidgetTilesetSource;
|
|
1139
|
+
};
|
|
1149
1140
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1141
|
+
* Source for Widget API requests on a data source defined by a tileset.
|
|
1142
|
+
*
|
|
1143
|
+
* Generally not intended to be constructed directly. Instead, call
|
|
1144
|
+
* {@link vectorTilesetSource}, {@link h3TilesetSource}, or {@link quadbinTilesetSource},
|
|
1145
|
+
* which can be shared with map layers. Sources contain a `widgetSource`
|
|
1146
|
+
* property, for use by widget implementations.
|
|
1147
|
+
*
|
|
1148
|
+
* Example:
|
|
1149
|
+
*
|
|
1150
|
+
* ```javascript
|
|
1151
|
+
* import { vectorTilesetSource } from '@carto/api-client';
|
|
1152
1152
|
*
|
|
1153
|
-
*
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1153
|
+
* const data = vectorTilesetSource({
|
|
1154
|
+
* accessToken: '••••',
|
|
1155
|
+
* connectionName: 'carto_dw',
|
|
1156
|
+
* tableName: 'carto-demo-data.demo_rasters.my_tileset_source'
|
|
1157
|
+
* });
|
|
1158
|
+
*
|
|
1159
|
+
* const { widgetSource } = await data;
|
|
1160
|
+
* ```
|
|
1157
1161
|
*/
|
|
1158
|
-
declare class
|
|
1159
|
-
|
|
1160
|
-
protected
|
|
1162
|
+
declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps> {
|
|
1163
|
+
protected _localImpl: WidgetTilesetSourceImpl | null;
|
|
1164
|
+
protected _workerImpl: Worker | null;
|
|
1165
|
+
protected _workerEnabled: boolean;
|
|
1161
1166
|
protected _workerNextRequestId: number;
|
|
1167
|
+
constructor(props: WidgetTilesetSourceProps);
|
|
1168
|
+
destroy(): void;
|
|
1162
1169
|
/**
|
|
1163
1170
|
* Returns an initialized Worker, to be reused for the lifecycle of this
|
|
1164
1171
|
* source instance.
|
|
1165
1172
|
*/
|
|
1166
|
-
_getWorker(): Worker;
|
|
1173
|
+
protected _getWorker(): Worker | null;
|
|
1167
1174
|
/** Executes a given method on the worker. */
|
|
1168
|
-
_executeWorkerMethod<T>(method: Method, params: unknown[], signal?: AbortSignal): Promise<T>;
|
|
1175
|
+
protected _executeWorkerMethod<T>(method: Method, params: unknown[], signal?: AbortSignal): Promise<T>;
|
|
1169
1176
|
/**
|
|
1170
1177
|
* Loads features as a list of tiles (typically provided by deck.gl).
|
|
1171
1178
|
* After tiles are loaded, {@link extractTileFeatures} must be called
|
|
@@ -1184,13 +1191,13 @@ declare class WidgetTilesetWorkerSource extends WidgetSource<WidgetTilesetSource
|
|
|
1184
1191
|
spatialFilter: SpatialFilter;
|
|
1185
1192
|
}): void;
|
|
1186
1193
|
getFeatures(): Promise<FeaturesResponse>;
|
|
1187
|
-
getFormula({
|
|
1188
|
-
getHistogram({
|
|
1189
|
-
getCategories({
|
|
1190
|
-
getScatter({
|
|
1191
|
-
getTable({
|
|
1192
|
-
getTimeSeries({
|
|
1193
|
-
getRange({
|
|
1194
|
+
getFormula({ signal, ...options }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
1195
|
+
getHistogram({ signal, ...options }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
1196
|
+
getCategories({ signal, ...options }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
1197
|
+
getScatter({ signal, ...options }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1198
|
+
getTable({ signal, ...options }: TableRequestOptions): Promise<TableResponse>;
|
|
1199
|
+
getTimeSeries({ signal, ...options }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1200
|
+
getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1194
1201
|
}
|
|
1195
1202
|
|
|
1196
1203
|
type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
@@ -1381,4 +1388,4 @@ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterInterv
|
|
|
1381
1388
|
*/
|
|
1382
1389
|
declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
|
|
1383
1390
|
|
|
1384
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, 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 RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, 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, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult,
|
|
1391
|
+
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, 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 RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, 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, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, clearFilters, createPolygonSpatialFilter, createViewportSpatialFilter, filterFunctions, geojsonFeatures, getClient, getDataFilterExtensionProps, getFilter, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|
package/build/api-client.d.ts
CHANGED
|
@@ -681,11 +681,11 @@ interface ViewState {
|
|
|
681
681
|
}
|
|
682
682
|
/** Common options for {@link WidgetRemoteSource} requests. */
|
|
683
683
|
interface BaseRequestOptions {
|
|
684
|
+
signal?: AbortSignal;
|
|
684
685
|
spatialFilter?: SpatialFilter;
|
|
685
686
|
spatialFiltersMode?: SpatialFilterPolyfillMode;
|
|
686
687
|
/** Required for table- and query-based spatial index sources (H3, Quadbin). */
|
|
687
688
|
spatialIndexReferenceViewState?: ViewState;
|
|
688
|
-
abortController?: AbortController;
|
|
689
689
|
/** Overrides source filters, if any. */
|
|
690
690
|
filters?: Filters;
|
|
691
691
|
filterOwner?: string;
|
|
@@ -863,6 +863,14 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps> {
|
|
|
863
863
|
readonly props: Props;
|
|
864
864
|
static defaultProps: Partial<WidgetSourceProps>;
|
|
865
865
|
constructor(props: Props);
|
|
866
|
+
/**
|
|
867
|
+
* Destroys the widget source and releases allocated resources.
|
|
868
|
+
*
|
|
869
|
+
* For remote sources (tables, queries) this has no effect, but for local
|
|
870
|
+
* sources (tilesets, rasters) these resources will affect performance
|
|
871
|
+
* and stability if many (10+) sources are created and not released.
|
|
872
|
+
*/
|
|
873
|
+
destroy(): void;
|
|
866
874
|
protected _getSpatialFiltersResolution(source: Omit<ModelSource, 'type' | 'data'>, spatialFilter?: SpatialFilter, referenceViewState?: ViewState): number | undefined;
|
|
867
875
|
/**
|
|
868
876
|
* Returns a list of labeled datapoints for categorical data. Suitable for
|
|
@@ -1066,36 +1074,26 @@ type TileFeaturesSpatialIndexOptions = {
|
|
|
1066
1074
|
};
|
|
1067
1075
|
declare function tileFeaturesSpatialIndex({ tiles, spatialFilter, spatialDataColumn, spatialDataType, }: TileFeaturesSpatialIndexOptions): FeatureData[];
|
|
1068
1076
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1077
|
+
declare enum Method {
|
|
1078
|
+
INIT = "init",
|
|
1079
|
+
LOAD_TILES = "loadTiles",
|
|
1080
|
+
SET_TILE_FEATURE_EXTRACT_OPTIONS = "setTileFeatureExtractOptions",
|
|
1081
|
+
LOAD_GEOJSON = "loadGeoJSON",
|
|
1082
|
+
GET_FORMULA = "getFormula",
|
|
1083
|
+
GET_HISTOGRAM = "getHistogram",
|
|
1084
|
+
GET_CATEGORIES = "getCategories",
|
|
1085
|
+
GET_SCATTER = "getScatter",
|
|
1086
|
+
GET_TABLE = "getTable",
|
|
1087
|
+
GET_TIME_SERIES = "getTimeSeries",
|
|
1088
|
+
GET_RANGE = "getRange"
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1076
1091
|
/**
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1079
|
-
*
|
|
1080
|
-
* {@link vectorTilesetSource}, {@link h3TilesetSource}, or {@link quadbinTilesetSource},
|
|
1081
|
-
* which can be shared with map layers. Sources contain a `widgetSource`
|
|
1082
|
-
* property, for use by widget implementations.
|
|
1083
|
-
*
|
|
1084
|
-
* Example:
|
|
1085
|
-
*
|
|
1086
|
-
* ```javascript
|
|
1087
|
-
* import { vectorTilesetSource } from '@carto/api-client';
|
|
1088
|
-
*
|
|
1089
|
-
* const data = vectorTilesetSource({
|
|
1090
|
-
* accessToken: '••••',
|
|
1091
|
-
* connectionName: 'carto_dw',
|
|
1092
|
-
* tableName: 'carto-demo-data.demo_rasters.my_tileset_source'
|
|
1093
|
-
* });
|
|
1094
|
-
*
|
|
1095
|
-
* const { widgetSource } = await data;
|
|
1096
|
-
* ```
|
|
1092
|
+
* Local (in-memory) implementation of tileset widget calculations. This class
|
|
1093
|
+
* may be instantiated by {@link WidgetTilesetSource} in a Web Worker when
|
|
1094
|
+
* supported, or on the main thread.
|
|
1097
1095
|
*/
|
|
1098
|
-
declare class
|
|
1096
|
+
declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourceProps> {
|
|
1099
1097
|
private _tiles;
|
|
1100
1098
|
private _features;
|
|
1101
1099
|
private _tileFeatureExtractOptions;
|
|
@@ -1132,40 +1130,49 @@ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps>
|
|
|
1132
1130
|
private _getFilteredFeatures;
|
|
1133
1131
|
}
|
|
1134
1132
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
GET_CATEGORIES = "getCategories",
|
|
1143
|
-
GET_SCATTER = "getScatter",
|
|
1144
|
-
GET_TABLE = "getTable",
|
|
1145
|
-
GET_TIME_SERIES = "getTimeSeries",
|
|
1146
|
-
GET_RANGE = "getRange"
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1133
|
+
type WidgetTilesetSourceProps = WidgetSourceProps & Omit<TilesetSourceOptions, 'filters'> & {
|
|
1134
|
+
tileFormat: TileFormat;
|
|
1135
|
+
spatialDataType: SpatialDataType;
|
|
1136
|
+
};
|
|
1137
|
+
type WidgetTilesetSourceResult = {
|
|
1138
|
+
widgetSource: WidgetTilesetSource;
|
|
1139
|
+
};
|
|
1149
1140
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1141
|
+
* Source for Widget API requests on a data source defined by a tileset.
|
|
1142
|
+
*
|
|
1143
|
+
* Generally not intended to be constructed directly. Instead, call
|
|
1144
|
+
* {@link vectorTilesetSource}, {@link h3TilesetSource}, or {@link quadbinTilesetSource},
|
|
1145
|
+
* which can be shared with map layers. Sources contain a `widgetSource`
|
|
1146
|
+
* property, for use by widget implementations.
|
|
1147
|
+
*
|
|
1148
|
+
* Example:
|
|
1149
|
+
*
|
|
1150
|
+
* ```javascript
|
|
1151
|
+
* import { vectorTilesetSource } from '@carto/api-client';
|
|
1152
1152
|
*
|
|
1153
|
-
*
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1153
|
+
* const data = vectorTilesetSource({
|
|
1154
|
+
* accessToken: '••••',
|
|
1155
|
+
* connectionName: 'carto_dw',
|
|
1156
|
+
* tableName: 'carto-demo-data.demo_rasters.my_tileset_source'
|
|
1157
|
+
* });
|
|
1158
|
+
*
|
|
1159
|
+
* const { widgetSource } = await data;
|
|
1160
|
+
* ```
|
|
1157
1161
|
*/
|
|
1158
|
-
declare class
|
|
1159
|
-
|
|
1160
|
-
protected
|
|
1162
|
+
declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps> {
|
|
1163
|
+
protected _localImpl: WidgetTilesetSourceImpl | null;
|
|
1164
|
+
protected _workerImpl: Worker | null;
|
|
1165
|
+
protected _workerEnabled: boolean;
|
|
1161
1166
|
protected _workerNextRequestId: number;
|
|
1167
|
+
constructor(props: WidgetTilesetSourceProps);
|
|
1168
|
+
destroy(): void;
|
|
1162
1169
|
/**
|
|
1163
1170
|
* Returns an initialized Worker, to be reused for the lifecycle of this
|
|
1164
1171
|
* source instance.
|
|
1165
1172
|
*/
|
|
1166
|
-
_getWorker(): Worker;
|
|
1173
|
+
protected _getWorker(): Worker | null;
|
|
1167
1174
|
/** Executes a given method on the worker. */
|
|
1168
|
-
_executeWorkerMethod<T>(method: Method, params: unknown[], signal?: AbortSignal): Promise<T>;
|
|
1175
|
+
protected _executeWorkerMethod<T>(method: Method, params: unknown[], signal?: AbortSignal): Promise<T>;
|
|
1169
1176
|
/**
|
|
1170
1177
|
* Loads features as a list of tiles (typically provided by deck.gl).
|
|
1171
1178
|
* After tiles are loaded, {@link extractTileFeatures} must be called
|
|
@@ -1184,13 +1191,13 @@ declare class WidgetTilesetWorkerSource extends WidgetSource<WidgetTilesetSource
|
|
|
1184
1191
|
spatialFilter: SpatialFilter;
|
|
1185
1192
|
}): void;
|
|
1186
1193
|
getFeatures(): Promise<FeaturesResponse>;
|
|
1187
|
-
getFormula({
|
|
1188
|
-
getHistogram({
|
|
1189
|
-
getCategories({
|
|
1190
|
-
getScatter({
|
|
1191
|
-
getTable({
|
|
1192
|
-
getTimeSeries({
|
|
1193
|
-
getRange({
|
|
1194
|
+
getFormula({ signal, ...options }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
1195
|
+
getHistogram({ signal, ...options }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
1196
|
+
getCategories({ signal, ...options }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
1197
|
+
getScatter({ signal, ...options }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1198
|
+
getTable({ signal, ...options }: TableRequestOptions): Promise<TableResponse>;
|
|
1199
|
+
getTimeSeries({ signal, ...options }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1200
|
+
getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1194
1201
|
}
|
|
1195
1202
|
|
|
1196
1203
|
type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
@@ -1381,4 +1388,4 @@ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterInterv
|
|
|
1381
1388
|
*/
|
|
1382
1389
|
declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
|
|
1383
1390
|
|
|
1384
|
-
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, 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 RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, 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, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult,
|
|
1391
|
+
export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, 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 RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, 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, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, clearFilters, createPolygonSpatialFilter, createViewportSpatialFilter, filterFunctions, geojsonFeatures, getClient, getDataFilterExtensionProps, getFilter, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
|