@carto/api-client 0.5.0-alpha.2 → 0.5.0-alpha.4
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 +4 -0
- package/build/api/carto-api-error.d.ts +1 -1
- package/build/api/query.d.ts +1 -1
- package/build/api/request-with-parameters.d.ts +2 -2
- package/build/api-client.cjs +2380 -2508
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.modern.js +2220 -2349
- package/build/api-client.modern.js.map +1 -1
- package/build/client.d.ts +2 -2
- package/build/constants-internal.d.ts +5 -5
- package/build/constants.d.ts +6 -6
- package/build/deck/get-data-filter-extension-props.d.ts +18 -0
- package/build/deck/index.d.ts +1 -0
- package/build/filters/Filter.d.ts +15 -3
- package/build/filters/FilterTypes.d.ts +1 -1
- package/build/filters/geosjonFeatures.d.ts +2 -2
- package/build/filters/tileFeatures.d.ts +10 -9
- package/build/filters/tileFeaturesRaster.d.ts +16 -0
- package/build/filters.d.ts +2 -2
- package/build/geo.d.ts +1 -1
- package/build/index.d.ts +2 -0
- package/build/models/common.d.ts +4 -3
- package/build/models/model.d.ts +2 -2
- package/build/operations/aggregation.d.ts +5 -5
- package/build/operations/applySorting.d.ts +3 -3
- package/build/operations/groupBy.d.ts +4 -4
- package/build/operations/groupByDate.d.ts +1 -1
- package/build/operations/histogram.d.ts +3 -3
- package/build/operations/scatterPlot.d.ts +3 -3
- package/build/sources/base-source.d.ts +2 -2
- package/build/sources/boundary-query-source.d.ts +1 -1
- package/build/sources/boundary-table-source.d.ts +1 -1
- package/build/sources/h3-query-source.d.ts +2 -2
- package/build/sources/h3-table-source.d.ts +2 -2
- package/build/sources/h3-tileset-source.d.ts +2 -2
- package/build/sources/index.d.ts +26 -26
- package/build/sources/quadbin-query-source.d.ts +2 -2
- package/build/sources/quadbin-table-source.d.ts +2 -2
- package/build/sources/quadbin-tileset-source.d.ts +2 -2
- package/build/sources/raster-source.d.ts +3 -2
- package/build/sources/types.d.ts +4 -4
- package/build/sources/vector-query-source.d.ts +1 -1
- package/build/sources/vector-table-source.d.ts +1 -1
- package/build/sources/vector-tileset-source.d.ts +2 -2
- package/build/spatial-index.d.ts +10 -4
- package/build/types-internal.d.ts +5 -5
- package/build/types.d.ts +23 -15
- package/build/utils/makeIntervalComplete.d.ts +1 -1
- package/build/utils.d.ts +3 -3
- package/build/widget-sources/index.d.ts +1 -0
- package/build/widget-sources/types.d.ts +4 -2
- package/build/widget-sources/widget-query-source.d.ts +2 -1
- package/build/widget-sources/widget-raster-source.d.ts +11 -0
- package/build/widget-sources/widget-remote-source.d.ts +3 -0
- package/build/widget-sources/widget-source.d.ts +3 -3
- package/build/widget-sources/widget-table-source.d.ts +2 -1
- package/build/widget-sources/widget-tileset-source.d.ts +21 -22
- package/package.json +44 -32
- package/src/api/carto-api-error.ts +1 -1
- package/src/api/query.ts +5 -5
- package/src/api/request-with-parameters.ts +6 -6
- package/src/client.ts +3 -3
- package/src/constants-internal.ts +5 -5
- package/src/constants.ts +6 -6
- package/src/deck/get-data-filter-extension-props.ts +146 -0
- package/src/deck/index.ts +1 -0
- package/src/filters/Filter.ts +18 -8
- package/src/filters/FilterTypes.ts +2 -2
- package/src/filters/geosjonFeatures.ts +2 -2
- package/src/filters/tileFeatures.ts +33 -23
- package/src/filters/tileFeaturesRaster.ts +111 -0
- package/src/filters.ts +4 -4
- package/src/geo.ts +12 -14
- package/src/index.ts +3 -0
- package/src/models/common.ts +9 -7
- package/src/models/model.ts +3 -4
- package/src/operations/aggregation.ts +5 -5
- package/src/operations/applySorting.ts +4 -4
- package/src/operations/groupBy.ts +4 -4
- package/src/operations/groupByDate.ts +1 -1
- package/src/operations/histogram.ts +4 -4
- package/src/operations/scatterPlot.ts +4 -4
- package/src/sources/base-source.ts +8 -8
- package/src/sources/boundary-query-source.ts +2 -2
- package/src/sources/boundary-table-source.ts +2 -2
- package/src/sources/h3-query-source.ts +7 -5
- package/src/sources/h3-table-source.ts +7 -5
- package/src/sources/h3-tileset-source.ts +4 -4
- package/src/sources/index.ts +26 -26
- package/src/sources/quadbin-query-source.ts +7 -5
- package/src/sources/quadbin-table-source.ts +7 -5
- package/src/sources/quadbin-tileset-source.ts +4 -4
- package/src/sources/raster-source.ts +20 -7
- package/src/sources/types.ts +4 -4
- package/src/sources/vector-query-source.ts +2 -3
- package/src/sources/vector-table-source.ts +2 -3
- package/src/sources/vector-tileset-source.ts +5 -5
- package/src/spatial-index.ts +12 -10
- package/src/types-internal.ts +5 -5
- package/src/types.ts +21 -15
- package/src/utils/makeIntervalComplete.ts +1 -1
- package/src/utils.ts +3 -3
- package/src/widget-sources/index.ts +1 -0
- package/src/widget-sources/types.ts +5 -3
- package/src/widget-sources/widget-query-source.ts +6 -2
- package/src/widget-sources/widget-raster-source.ts +14 -0
- package/src/widget-sources/widget-remote-source.ts +31 -16
- package/src/widget-sources/widget-source.ts +13 -4
- package/src/widget-sources/widget-table-source.ts +6 -2
- package/src/widget-sources/widget-tileset-source.ts +133 -85
package/build/client.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Returns current client ID, used to categorize API requests. For internal use only.
|
|
3
3
|
*
|
|
4
4
|
* @internal
|
|
5
|
-
* @
|
|
5
|
+
* @privateRemarks Source: @carto/react-core
|
|
6
6
|
*/
|
|
7
7
|
export declare function getClient(): string;
|
|
8
8
|
/**
|
|
9
9
|
* Sets current client ID, used to categorize API requests. For internal use only.
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
|
-
* @
|
|
12
|
+
* @privateRemarks Source: @carto/react-core
|
|
13
13
|
*/
|
|
14
14
|
export declare function setClient(c: string): void;
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
export declare const API_CLIENT_VERSION: string;
|
|
6
6
|
/** @internal */
|
|
7
7
|
export declare const V3_MINOR_VERSION = "3.4";
|
|
8
|
-
/** @
|
|
8
|
+
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
9
9
|
export declare const DEFAULT_GEO_COLUMN = "geom";
|
|
10
10
|
/**
|
|
11
11
|
* Fastly default limit is 8192; leave some padding.
|
|
12
|
-
* @
|
|
12
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
13
13
|
*/
|
|
14
14
|
export declare const DEFAULT_MAX_LENGTH_URL = 7000;
|
|
15
|
-
/** @
|
|
15
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
16
16
|
export declare const DEFAULT_TILE_RESOLUTION = 0.5;
|
|
17
17
|
/**
|
|
18
|
-
* @
|
|
18
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare const DEFAULT_AGGREGATION_RES_LEVEL_H3 = 4;
|
|
22
22
|
/**
|
|
23
|
-
* @
|
|
23
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
export declare const DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN = 6;
|
package/build/constants.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* };
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @privateRemarks Source: @carto/react-api, @deck.gl/carto
|
|
14
14
|
*/
|
|
15
15
|
export declare enum FilterType {
|
|
16
16
|
IN = "in",
|
|
@@ -21,28 +21,28 @@ export declare enum FilterType {
|
|
|
21
21
|
TIME = "time",
|
|
22
22
|
STRING_SEARCH = "stringSearch"
|
|
23
23
|
}
|
|
24
|
-
/** @
|
|
24
|
+
/** @privateRemarks Source: @carto/constants */
|
|
25
25
|
export declare enum ApiVersion {
|
|
26
26
|
V1 = "v1",
|
|
27
27
|
V2 = "v2",
|
|
28
28
|
V3 = "v3"
|
|
29
29
|
}
|
|
30
|
-
/** @
|
|
30
|
+
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
31
31
|
export declare const DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
|
|
32
|
-
/** @
|
|
32
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
33
33
|
export declare enum TileFormat {
|
|
34
34
|
MVT = "mvt",
|
|
35
35
|
JSON = "json",
|
|
36
36
|
GEOJSON = "geojson",
|
|
37
37
|
BINARY = "binary"
|
|
38
38
|
}
|
|
39
|
-
/** @
|
|
39
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
40
40
|
export declare enum SpatialIndex {
|
|
41
41
|
H3 = "h3",
|
|
42
42
|
S2 = "s2",
|
|
43
43
|
QUADBIN = "quadbin"
|
|
44
44
|
}
|
|
45
|
-
/** @
|
|
45
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
46
46
|
export declare enum Provider {
|
|
47
47
|
BIGQUERY = "bigquery",
|
|
48
48
|
REDSHIFT = "redshift",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Feature } from 'geojson';
|
|
2
|
+
import { FilterLogicalOperator, Filters } from '../types.js';
|
|
3
|
+
import { FeatureData } from '../types-internal.js';
|
|
4
|
+
/** @experimental Prefer type definition from deck.gl. */
|
|
5
|
+
export type _DataFilterExtensionProps = {
|
|
6
|
+
filterRange: number[][];
|
|
7
|
+
updateTriggers: Record<string, string>;
|
|
8
|
+
getFilterValue: (feature: Feature | FeatureData) => number[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
|
|
12
|
+
* a set of filters.
|
|
13
|
+
*
|
|
14
|
+
* @privateRemarks DataFilterExtension accepts up to 4 values to filter. This
|
|
15
|
+
* implementation uses the 1st for all filters except the time filter, and the
|
|
16
|
+
* 2nd for the time filter.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator, filterSize?: 0 | 1 | 2 | 3 | 4): _DataFilterExtensionProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-data-filter-extension-props.js';
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { FilterLogicalOperator, Filters } from '../types';
|
|
1
|
+
import { FilterLogicalOperator, Filters } from '../types.js';
|
|
2
2
|
import { Feature } from 'geojson';
|
|
3
|
-
import { FeatureData } from '../types-internal';
|
|
3
|
+
import { FeatureData } from '../types-internal.js';
|
|
4
4
|
import { BinaryFeature } from '@loaders.gl/schema';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
|
|
8
|
+
*/
|
|
9
|
+
export declare function _buildFeatureFilter({ filters, type, filtersLogicalOperator, }: {
|
|
6
10
|
filters?: Filters;
|
|
7
11
|
type?: 'number' | 'boolean';
|
|
8
12
|
filtersLogicalOperator?: FilterLogicalOperator;
|
|
9
13
|
}): (feature: Feature | FeatureData) => number | boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Apply certain filters to a collection of features.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
10
18
|
export declare function applyFilters(features: FeatureData[], filters: Filters, filtersLogicalOperator: FilterLogicalOperator): FeatureData[];
|
|
19
|
+
/**
|
|
20
|
+
* Binary.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
11
23
|
export declare function buildBinaryFeatureFilter({ filters }: {
|
|
12
24
|
filters: Filters;
|
|
13
25
|
}): (() => number) | ((featureIdIdx: number, binaryData: BinaryFeature) => boolean);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FilterType } from '../constants';
|
|
1
|
+
import { FilterType } from '../constants.js';
|
|
2
2
|
export type FilterFunction = (filterValues: unknown[], featureValue: unknown, params?: Record<string, unknown>) => boolean;
|
|
3
3
|
export declare const filterFunctions: Record<FilterType, FilterFunction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeatureCollection } from 'geojson';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
|
+
import { SpatialFilter } from '../types.js';
|
|
4
4
|
export declare function geojsonFeatures({ geojson, spatialFilter, uniqueIdProperty, }: {
|
|
5
5
|
geojson: FeatureCollection;
|
|
6
6
|
spatialFilter: SpatialFilter;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { SpatialFilter, Tile } from '../types';
|
|
2
|
-
import { TileFormat } from '../constants';
|
|
3
|
-
import { FeatureData } from '../types-internal';
|
|
4
|
-
import { SpatialDataType } from '../sources/types';
|
|
5
|
-
/** @
|
|
1
|
+
import { SpatialFilter, Tile } from '../types.js';
|
|
2
|
+
import { TileFormat } from '../constants.js';
|
|
3
|
+
import { FeatureData } from '../types-internal.js';
|
|
4
|
+
import { RasterMetadata, SpatialDataType } from '../sources/types.js';
|
|
5
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
6
6
|
export type TileFeatures = {
|
|
7
7
|
tiles: Tile[];
|
|
8
8
|
tileFormat: TileFormat;
|
|
9
9
|
spatialDataType: SpatialDataType;
|
|
10
10
|
spatialDataColumn?: string;
|
|
11
|
-
spatialFilter
|
|
11
|
+
spatialFilter: SpatialFilter;
|
|
12
12
|
uniqueIdProperty?: string;
|
|
13
|
+
rasterMetadata?: RasterMetadata;
|
|
13
14
|
options?: TileFeatureExtractOptions;
|
|
14
15
|
};
|
|
15
|
-
/** @
|
|
16
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
16
17
|
export type TileFeatureExtractOptions = {
|
|
17
18
|
storeGeometry?: boolean;
|
|
18
19
|
};
|
|
19
|
-
/** @
|
|
20
|
-
export declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
|
|
20
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
21
|
+
export declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, rasterMetadata, options, }: TileFeatures): FeatureData[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RasterTile, SpatialFilter, Tile } from '../types.js';
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
|
+
import { RasterMetadata, SpatialDataType } from '../sources/types.js';
|
|
4
|
+
export type TileFeaturesRasterOptions = {
|
|
5
|
+
tiles: RasterTile[];
|
|
6
|
+
spatialFilter: SpatialFilter;
|
|
7
|
+
spatialDataColumn: string;
|
|
8
|
+
spatialDataType: SpatialDataType;
|
|
9
|
+
rasterMetadata: RasterMetadata;
|
|
10
|
+
};
|
|
11
|
+
export declare function tileFeaturesRaster({ tiles, ...options }: TileFeaturesRasterOptions): FeatureData[];
|
|
12
|
+
/**
|
|
13
|
+
* Detects whether a given {@link Tile} is a {@link RasterTile}.
|
|
14
|
+
* @privateRemarks Method of detection is arbitrary, and may be changed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isRasterTile(tile: Tile): tile is RasterTile;
|
package/build/filters.d.ts
CHANGED
package/build/geo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BBox, MultiPolygon, Polygon } from 'geojson';
|
|
2
|
-
import { SpatialFilter } from './types';
|
|
2
|
+
import { SpatialFilter } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns a {@link SpatialFilter} for a given viewport, typically obtained
|
|
5
5
|
* from deck.gl's `viewport.getBounds()` method ([west, south, east, north]).
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './client.js';
|
|
2
2
|
export * from './constants.js';
|
|
3
|
+
export * from './deck/index.js';
|
|
3
4
|
export * from './filters.js';
|
|
4
5
|
export * from './geo.js';
|
|
5
6
|
export * from './sources/index.js';
|
|
@@ -8,6 +9,7 @@ export * from './types.js';
|
|
|
8
9
|
export { APIErrorContext, APIRequestType, CartoAPIError, QueryOptions, buildPublicMapUrl, // Internal, but required for fetchMap().
|
|
9
10
|
buildStatsUrl, // Internal, but required for fetchMap().
|
|
10
11
|
query, requestWithParameters, } from './api/index.js';
|
|
12
|
+
export { _getHexagonResolution } from './spatial-index.js';
|
|
11
13
|
export * from './filters/index.js';
|
|
12
14
|
export * from './operations/index.js';
|
|
13
15
|
export * from './utils/makeIntervalComplete.js';
|
package/build/models/common.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/** @
|
|
1
|
+
/** @privateRemarks Source: @carto/react-api */
|
|
2
2
|
export interface ModelRequestOptions {
|
|
3
3
|
method: 'GET' | 'POST';
|
|
4
|
+
headers?: Record<string, string>;
|
|
4
5
|
abortController?: AbortController;
|
|
5
6
|
otherOptions?: Record<string, unknown>;
|
|
6
7
|
body?: string;
|
|
@@ -12,13 +13,13 @@ interface ModelErrorResponse {
|
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Return more descriptive error from API
|
|
15
|
-
* @
|
|
16
|
+
* @privateRemarks Source: @carto/react-api
|
|
16
17
|
*/
|
|
17
18
|
export declare function dealWithApiError({ response, data, }: {
|
|
18
19
|
response: Response;
|
|
19
20
|
data: ModelErrorResponse;
|
|
20
21
|
}): void;
|
|
21
|
-
/** @
|
|
22
|
+
/** @privateRemarks Source: @carto/react-api */
|
|
22
23
|
export declare function makeCall({ url, accessToken, opts, }: {
|
|
23
24
|
url: string;
|
|
24
25
|
accessToken: string;
|
package/build/models/model.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Filter, FilterLogicalOperator, MapType, QueryParameters, SpatialFilter
|
|
|
2
2
|
import { ModelRequestOptions } from './common.js';
|
|
3
3
|
import { ApiVersion } from '../constants.js';
|
|
4
4
|
import { SpatialDataType, SpatialFilterPolyfillMode } from '../sources/types.js';
|
|
5
|
-
/** @
|
|
5
|
+
/** @privateRemarks Source: @carto/react-api */
|
|
6
6
|
declare const AVAILABLE_MODELS: readonly ["category", "histogram", "formula", "pick", "timeseries", "range", "scatterplot", "table"];
|
|
7
7
|
export type Model = (typeof AVAILABLE_MODELS)[number];
|
|
8
8
|
export interface ModelSource {
|
|
@@ -26,7 +26,7 @@ export interface ModelSource {
|
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Execute a SQL model request.
|
|
29
|
-
* @
|
|
29
|
+
* @privateRemarks Source: @carto/react-api
|
|
30
30
|
*/
|
|
31
31
|
export declare function executeModel(props: {
|
|
32
32
|
model: Model;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AggregationType } from '../types';
|
|
2
|
-
import { FeatureData } from '../types-internal';
|
|
3
|
-
/** @
|
|
1
|
+
import { AggregationType } from '../types.js';
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
4
4
|
export type AggregationFunction = (values: unknown[] | FeatureData[], keys?: string[] | string, joinOperation?: AggregationType) => number;
|
|
5
|
-
/** @
|
|
5
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
6
6
|
export declare const aggregationFunctions: Record<Exclude<AggregationType, 'custom'>, AggregationFunction>;
|
|
7
|
-
/** @
|
|
7
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
8
8
|
export declare function aggregate(feature: FeatureData, keys?: string[], operation?: AggregationType): unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SortDirection } from '../types';
|
|
2
|
-
import { FeatureData } from '../types-internal';
|
|
1
|
+
import { SortDirection } from '../types.js';
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
3
|
type SortColumns = string | string[] | object[];
|
|
4
4
|
interface SortOptions {
|
|
5
5
|
sortBy?: SortColumns;
|
|
@@ -14,7 +14,7 @@ interface SortOptions {
|
|
|
14
14
|
* @param [sortOptions.sortByDirection] - Direction by the columns will be sorted
|
|
15
15
|
* @param [sortOptions.sortByColumnType] - Column type
|
|
16
16
|
* @internal
|
|
17
|
-
* @
|
|
17
|
+
* @privateRemarks Source: @carto/react-core
|
|
18
18
|
*/
|
|
19
19
|
export declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
|
|
20
20
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AggregationType } from '../types';
|
|
2
|
-
import { FeatureData } from '../types-internal';
|
|
3
|
-
/** @
|
|
1
|
+
import { AggregationType } from '../types.js';
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
4
4
|
export type GroupByFeature = {
|
|
5
5
|
name: string;
|
|
6
6
|
value: number;
|
|
7
7
|
}[];
|
|
8
|
-
/** @
|
|
8
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
9
9
|
export declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, }: {
|
|
10
10
|
data: FeatureData[];
|
|
11
11
|
valuesColumns?: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AggregationType, GroupDateType } from '../types.js';
|
|
2
2
|
import { GroupByFeature } from './groupBy.js';
|
|
3
|
-
/** @
|
|
3
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
4
4
|
export declare function groupValuesByDateColumn({ data, valuesColumns, joinOperation, keysColumn, groupType, operation, }: {
|
|
5
5
|
data: Record<string, unknown>[];
|
|
6
6
|
valuesColumns?: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AggregationType } from '../types';
|
|
2
|
-
import { FeatureData } from '../types-internal';
|
|
1
|
+
import { AggregationType } from '../types.js';
|
|
2
|
+
import { FeatureData } from '../types-internal.js';
|
|
3
3
|
/**
|
|
4
4
|
* Histogram computation.
|
|
5
|
-
* @
|
|
5
|
+
* @privateRemarks Source: @carto/react-core
|
|
6
6
|
*/
|
|
7
7
|
export declare function histogram({ data, valuesColumns, joinOperation, ticks, operation, }: {
|
|
8
8
|
data: FeatureData[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FeatureData } from '../types-internal';
|
|
2
|
-
import { AggregationType } from '../types';
|
|
1
|
+
import { FeatureData } from '../types-internal.js';
|
|
2
|
+
import { AggregationType } from '../types.js';
|
|
3
3
|
export type ScatterPlotFeature = [number, number][];
|
|
4
4
|
/**
|
|
5
5
|
* Filters invalid features and formats data.
|
|
6
|
-
* @
|
|
6
|
+
* @privateRemarks Source: @carto/react-core
|
|
7
7
|
*/
|
|
8
8
|
export declare function scatterPlot({ data, xAxisColumns, xAxisJoinOperation, yAxisColumns, yAxisJoinOperation, }: {
|
|
9
9
|
data: FeatureData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeojsonResult, JsonResult, SourceOptionalOptions, SourceRequiredOptions, TilejsonResult } from './types';
|
|
2
|
-
import { MapType } from '../types';
|
|
1
|
+
import type { GeojsonResult, JsonResult, SourceOptionalOptions, SourceRequiredOptions, TilejsonResult } from './types.js';
|
|
2
|
+
import { MapType } from '../types.js';
|
|
3
3
|
export declare const SOURCE_DEFAULTS: SourceOptionalOptions;
|
|
4
4
|
export declare function baseSource<UrlParameters extends Record<string, unknown>>(endpoint: MapType, options: Partial<SourceOptionalOptions> & SourceRequiredOptions, urlParameters: UrlParameters): Promise<TilejsonResult | GeojsonResult | JsonResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryParameters } from '../types.js';
|
|
2
|
-
import type { FilterOptions, SourceOptions, TilejsonResult } from './types';
|
|
2
|
+
import type { FilterOptions, SourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type BoundaryQuerySourceOptions = SourceOptions & FilterOptions & {
|
|
4
4
|
columns?: string[];
|
|
5
5
|
tilesetTableName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FilterOptions, SourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import type { FilterOptions, SourceOptions, TilejsonResult } from './types.js';
|
|
2
2
|
export type BoundaryTableSourceOptions = SourceOptions & FilterOptions & {
|
|
3
3
|
tilesetTableName: string;
|
|
4
4
|
columns?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetQuerySourceResult } from '../widget-sources';
|
|
2
|
-
import type { AggregationOptions, FilterOptions, QuerySourceOptions, SourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import { WidgetQuerySourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { AggregationOptions, FilterOptions, QuerySourceOptions, SourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
4
4
|
export type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
|
|
5
5
|
export declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetTableSourceResult } from '../widget-sources';
|
|
2
|
-
import type { AggregationOptions, FilterOptions, SourceOptions, TableSourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import { WidgetTableSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { AggregationOptions, FilterOptions, SourceOptions, TableSourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type H3TableSourceOptions = SourceOptions & TableSourceOptions & AggregationOptions & FilterOptions;
|
|
4
4
|
export type H3TableSourceResponse = TilejsonResult & WidgetTableSourceResult;
|
|
5
5
|
export declare const h3TableSource: (options: H3TableSourceOptions) => Promise<H3TableSourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetTilesetSourceResult } from '../widget-sources';
|
|
2
|
-
import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
|
|
1
|
+
import { WidgetTilesetSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
|
|
3
3
|
export type H3TilesetSourceOptions = SourceOptions & TilesetSourceOptions;
|
|
4
4
|
export type H3TilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
|
|
5
5
|
export declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
|
package/build/sources/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export { SOURCE_DEFAULTS } from './base-source';
|
|
2
|
-
export type { GeojsonResult, JsonResult, QueryResult, QuerySourceOptions, RasterBandColorinterp, RasterMetadata, RasterMetadataBand, RasterMetadataBandStats, SourceOptions, SpatialFilterPolyfillMode, TableSourceOptions, TilejsonResult, TileResolution, TilesetSourceOptions, VectorLayer, } from './types';
|
|
3
|
-
export { boundaryQuerySource } from './boundary-query-source';
|
|
4
|
-
export type { BoundaryQuerySourceOptions, BoundaryQuerySourceResponse, } from './boundary-query-source';
|
|
5
|
-
export { boundaryTableSource } from './boundary-table-source';
|
|
6
|
-
export type { BoundaryTableSourceOptions, BoundaryTableSourceResponse, } from './boundary-table-source';
|
|
7
|
-
export { h3QuerySource } from './h3-query-source';
|
|
8
|
-
export type { H3QuerySourceOptions, H3QuerySourceResponse, } from './h3-query-source';
|
|
9
|
-
export { h3TableSource } from './h3-table-source';
|
|
10
|
-
export type { H3TableSourceOptions, H3TableSourceResponse, } from './h3-table-source';
|
|
11
|
-
export { h3TilesetSource } from './h3-tileset-source';
|
|
12
|
-
export type { H3TilesetSourceOptions, H3TilesetSourceResponse, } from './h3-tileset-source';
|
|
13
|
-
export { rasterSource } from './raster-source';
|
|
14
|
-
export type { RasterSourceOptions } from './raster-source';
|
|
15
|
-
export { quadbinQuerySource } from './quadbin-query-source';
|
|
16
|
-
export type { QuadbinQuerySourceOptions, QuadbinQuerySourceResponse, } from './quadbin-query-source';
|
|
17
|
-
export { quadbinTableSource } from './quadbin-table-source';
|
|
18
|
-
export type { QuadbinTableSourceOptions, QuadbinTableSourceResponse, } from './quadbin-table-source';
|
|
19
|
-
export { quadbinTilesetSource } from './quadbin-tileset-source';
|
|
20
|
-
export type { QuadbinTilesetSourceOptions, QuadbinTilesetSourceResponse, } from './quadbin-tileset-source';
|
|
21
|
-
export { vectorQuerySource } from './vector-query-source';
|
|
22
|
-
export type { VectorQuerySourceOptions, VectorQuerySourceResponse, } from './vector-query-source';
|
|
23
|
-
export { vectorTableSource } from './vector-table-source';
|
|
24
|
-
export type { VectorTableSourceOptions, VectorTableSourceResponse, } from './vector-table-source';
|
|
25
|
-
export { vectorTilesetSource } from './vector-tileset-source';
|
|
26
|
-
export type { VectorTilesetSourceOptions, VectorTilesetSourceResponse, } from './vector-tileset-source';
|
|
1
|
+
export { SOURCE_DEFAULTS } from './base-source.js';
|
|
2
|
+
export type { GeojsonResult, JsonResult, QueryResult, QuerySourceOptions, RasterBandColorinterp, RasterMetadata, RasterMetadataBand, RasterMetadataBandStats, SourceOptions, SpatialFilterPolyfillMode, TableSourceOptions, TilejsonResult, TileResolution, TilesetSourceOptions, VectorLayer, } from './types.js';
|
|
3
|
+
export { boundaryQuerySource } from './boundary-query-source.js';
|
|
4
|
+
export type { BoundaryQuerySourceOptions, BoundaryQuerySourceResponse, } from './boundary-query-source.js';
|
|
5
|
+
export { boundaryTableSource } from './boundary-table-source.js';
|
|
6
|
+
export type { BoundaryTableSourceOptions, BoundaryTableSourceResponse, } from './boundary-table-source.js';
|
|
7
|
+
export { h3QuerySource } from './h3-query-source.js';
|
|
8
|
+
export type { H3QuerySourceOptions, H3QuerySourceResponse, } from './h3-query-source.js';
|
|
9
|
+
export { h3TableSource } from './h3-table-source.js';
|
|
10
|
+
export type { H3TableSourceOptions, H3TableSourceResponse, } from './h3-table-source.js';
|
|
11
|
+
export { h3TilesetSource } from './h3-tileset-source.js';
|
|
12
|
+
export type { H3TilesetSourceOptions, H3TilesetSourceResponse, } from './h3-tileset-source.js';
|
|
13
|
+
export { rasterSource } from './raster-source.js';
|
|
14
|
+
export type { RasterSourceOptions } from './raster-source.js';
|
|
15
|
+
export { quadbinQuerySource } from './quadbin-query-source.js';
|
|
16
|
+
export type { QuadbinQuerySourceOptions, QuadbinQuerySourceResponse, } from './quadbin-query-source.js';
|
|
17
|
+
export { quadbinTableSource } from './quadbin-table-source.js';
|
|
18
|
+
export type { QuadbinTableSourceOptions, QuadbinTableSourceResponse, } from './quadbin-table-source.js';
|
|
19
|
+
export { quadbinTilesetSource } from './quadbin-tileset-source.js';
|
|
20
|
+
export type { QuadbinTilesetSourceOptions, QuadbinTilesetSourceResponse, } from './quadbin-tileset-source.js';
|
|
21
|
+
export { vectorQuerySource } from './vector-query-source.js';
|
|
22
|
+
export type { VectorQuerySourceOptions, VectorQuerySourceResponse, } from './vector-query-source.js';
|
|
23
|
+
export { vectorTableSource } from './vector-table-source.js';
|
|
24
|
+
export type { VectorTableSourceOptions, VectorTableSourceResponse, } from './vector-table-source.js';
|
|
25
|
+
export { vectorTilesetSource } from './vector-tileset-source.js';
|
|
26
|
+
export type { VectorTilesetSourceOptions, VectorTilesetSourceResponse, } from './vector-tileset-source.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetQuerySourceResult } from '../widget-sources';
|
|
2
|
-
import type { AggregationOptions, FilterOptions, QuerySourceOptions, SourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import { WidgetQuerySourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { AggregationOptions, FilterOptions, QuerySourceOptions, SourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
|
|
4
4
|
export type QuadbinQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
|
|
5
5
|
export declare const quadbinQuerySource: (options: QuadbinQuerySourceOptions) => Promise<QuadbinQuerySourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetTableSourceResult } from '../widget-sources';
|
|
2
|
-
import type { AggregationOptions, FilterOptions, SourceOptions, TableSourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import { WidgetTableSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { AggregationOptions, FilterOptions, SourceOptions, TableSourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type QuadbinTableSourceOptions = SourceOptions & TableSourceOptions & AggregationOptions & FilterOptions;
|
|
4
4
|
export type QuadbinTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
|
|
5
5
|
export declare const quadbinTableSource: (options: QuadbinTableSourceOptions) => Promise<QuadbinTableSourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetTilesetSourceResult } from '../widget-sources';
|
|
2
|
-
import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
|
|
1
|
+
import { WidgetTilesetSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
|
|
3
3
|
export type QuadbinTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
|
|
4
4
|
export type QuadbinTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
|
|
5
5
|
export declare const quadbinTilesetSource: (options: QuadbinTilesetSourceOptions) => Promise<QuadbinTilesetSourceResponse>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { WidgetRasterSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { FilterOptions, SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
|
|
2
3
|
export type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
|
|
3
|
-
export type RasterSourceResponse = TilejsonResult;
|
|
4
|
+
export type RasterSourceResponse = TilejsonResult & WidgetRasterSourceResult;
|
|
4
5
|
export declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
|
package/build/sources/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Feature } from 'geojson';
|
|
2
|
-
import { Filters, Format, QueryParameters } from '../types';
|
|
3
|
-
import { MapInstantiation } from '../types-internal';
|
|
2
|
+
import { Filters, Format, QueryParameters } from '../types.js';
|
|
3
|
+
import { MapInstantiation } from '../types-internal.js';
|
|
4
4
|
export type SourceRequiredOptions = {
|
|
5
5
|
/** Carto platform access token. */
|
|
6
6
|
accessToken: string;
|
|
@@ -178,7 +178,7 @@ export type SpatialDataType = 'geo' | 'h3' | 'quadbin';
|
|
|
178
178
|
* Strategy used for covering spatial filter geometry with spatial indexes.
|
|
179
179
|
* See https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/sql-reference/quadbin#quadbin_polyfill_mode
|
|
180
180
|
* or https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/sql-reference/h3#h3_polyfill_mode for more information.
|
|
181
|
-
* @
|
|
181
|
+
* @privateRemarks Source: cloud-native maps-api
|
|
182
182
|
* */
|
|
183
183
|
export type SpatialFilterPolyfillMode = 'center' | 'intersects' | 'contains';
|
|
184
184
|
export type TilejsonMapInstantiation = MapInstantiation & {
|
|
@@ -319,7 +319,7 @@ export type RasterMetadataBand = {
|
|
|
319
319
|
/**
|
|
320
320
|
* Default color mapping for unique values (or if coloprinterp is `palette`)
|
|
321
321
|
*/
|
|
322
|
-
colortable?: Record<string, number
|
|
322
|
+
colortable?: Record<string, [number, number, number, number]>;
|
|
323
323
|
/**
|
|
324
324
|
* No value representation.
|
|
325
325
|
* Observed values:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetQuerySourceResult } from '../widget-sources/index.js';
|
|
2
|
-
import type { FilterOptions, SourceOptions, QuerySourceOptions, TilejsonResult, ColumnsOption } from './types';
|
|
2
|
+
import type { FilterOptions, SourceOptions, QuerySourceOptions, TilejsonResult, ColumnsOption } from './types.js';
|
|
3
3
|
export type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption;
|
|
4
4
|
export type VectorQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
|
|
5
5
|
export declare const vectorQuerySource: (options: VectorQuerySourceOptions) => Promise<VectorQuerySourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WidgetTableSourceResult } from '../widget-sources/index.js';
|
|
2
|
-
import type { FilterOptions, ColumnsOption, SourceOptions, TableSourceOptions, TilejsonResult } from './types';
|
|
2
|
+
import type { FilterOptions, ColumnsOption, SourceOptions, TableSourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption;
|
|
4
4
|
export type VectorTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
|
|
5
5
|
export declare const vectorTableSource: (options: VectorTableSourceOptions) => Promise<VectorTableSourceResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WidgetTilesetSourceResult } from '../widget-sources';
|
|
2
|
-
import type { SourceOptions, TilesetSourceOptions, TilejsonResult } from './types';
|
|
1
|
+
import { WidgetTilesetSourceResult } from '../widget-sources/index.js';
|
|
2
|
+
import type { SourceOptions, TilesetSourceOptions, TilejsonResult } from './types.js';
|
|
3
3
|
export type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
|
|
4
4
|
export type VectorTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
|
|
5
5
|
export declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
|
package/build/spatial-index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { ModelSource } from './models/model';
|
|
2
|
-
import type { AggregationOptions } from './sources/types';
|
|
3
|
-
import type { ViewState } from './widget-sources';
|
|
1
|
+
import type { ModelSource } from './models/model.js';
|
|
2
|
+
import type { AggregationOptions } from './sources/types.js';
|
|
3
|
+
import type { ViewState } from './widget-sources/index.js';
|
|
4
4
|
export declare function getSpatialFiltersResolution(source: Partial<ModelSource & AggregationOptions>, viewState: ViewState): number | undefined;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Resolution conversion function. Takes a WebMercatorViewport and returns
|
|
7
|
+
* a H3 resolution such that the screen space size of the hexagons is
|
|
8
|
+
* "similar" to the given tileSize on screen. Intended for use with deck.gl.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function _getHexagonResolution(viewport: {
|
|
6
12
|
zoom: number;
|
|
7
13
|
latitude: number;
|
|
8
14
|
}, tileSize: number): number;
|