@carto/api-client 0.4.6 → 0.4.7-alpha.0

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.
Files changed (124) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/build/api/carto-api-error.d.ts +1 -1
  3. package/build/api/query.d.ts +1 -1
  4. package/build/api/request-with-parameters.d.ts +2 -2
  5. package/build/api-client.cjs +2365 -279
  6. package/build/api-client.cjs.map +1 -1
  7. package/build/api-client.modern.js +2274 -298
  8. package/build/api-client.modern.js.map +1 -1
  9. package/build/client.d.ts +2 -2
  10. package/build/constants-internal.d.ts +5 -5
  11. package/build/constants.d.ts +25 -3
  12. package/build/deck/get-data-filter-extension-props.d.ts +28 -0
  13. package/build/deck/index.d.ts +1 -0
  14. package/build/filters/Filter.d.ts +25 -0
  15. package/build/filters/FilterTypes.d.ts +3 -0
  16. package/build/filters/geosjonFeatures.d.ts +8 -0
  17. package/build/filters/index.d.ts +6 -0
  18. package/build/filters/tileFeatures.d.ts +20 -0
  19. package/build/filters/tileFeaturesGeometries.d.ts +13 -0
  20. package/build/filters/tileFeaturesSpatialIndex.d.ts +10 -0
  21. package/build/filters.d.ts +2 -2
  22. package/build/geo.d.ts +1 -1
  23. package/build/index.d.ts +5 -0
  24. package/build/models/common.d.ts +5 -4
  25. package/build/models/index.d.ts +1 -1
  26. package/build/models/model.d.ts +2 -2
  27. package/build/operations/aggregation.d.ts +8 -0
  28. package/build/operations/applySorting.d.ts +20 -0
  29. package/build/operations/groupBy.d.ts +15 -0
  30. package/build/operations/groupByDate.d.ts +11 -0
  31. package/build/operations/histogram.d.ts +13 -0
  32. package/build/operations/index.d.ts +6 -0
  33. package/build/operations/scatterPlot.d.ts +14 -0
  34. package/build/sources/base-source.d.ts +2 -2
  35. package/build/sources/boundary-query-source.d.ts +1 -1
  36. package/build/sources/boundary-table-source.d.ts +1 -1
  37. package/build/sources/h3-query-source.d.ts +2 -2
  38. package/build/sources/h3-table-source.d.ts +2 -2
  39. package/build/sources/h3-tileset-source.d.ts +1 -1
  40. package/build/sources/index.d.ts +26 -26
  41. package/build/sources/quadbin-query-source.d.ts +2 -2
  42. package/build/sources/quadbin-table-source.d.ts +2 -2
  43. package/build/sources/quadbin-tileset-source.d.ts +1 -1
  44. package/build/sources/raster-source.d.ts +1 -1
  45. package/build/sources/types.d.ts +3 -3
  46. package/build/sources/vector-query-source.d.ts +1 -1
  47. package/build/sources/vector-table-source.d.ts +1 -1
  48. package/build/sources/vector-tileset-source.d.ts +1 -1
  49. package/build/spatial-index.d.ts +3 -3
  50. package/build/types-internal.d.ts +9 -5
  51. package/build/types.d.ts +74 -14
  52. package/build/utils/dateUtils.d.ts +10 -0
  53. package/build/utils/getTileFormat.d.ts +3 -0
  54. package/build/utils/makeIntervalComplete.d.ts +2 -0
  55. package/build/utils/transformTileCoordsToWGS84.d.ts +8 -0
  56. package/build/utils/transformToTileCoords.d.ts +9 -0
  57. package/build/utils.d.ts +3 -3
  58. package/build/widget-sources/index.d.ts +3 -1
  59. package/build/widget-sources/types.d.ts +38 -25
  60. package/build/widget-sources/widget-query-source.d.ts +4 -3
  61. package/build/widget-sources/widget-remote-source.d.ts +18 -0
  62. package/build/widget-sources/{widget-base-source.d.ts → widget-source.d.ts} +16 -41
  63. package/build/widget-sources/widget-table-source.d.ts +4 -3
  64. package/build/widget-sources/widget-tileset-source.d.ts +75 -0
  65. package/package.json +46 -29
  66. package/src/api/carto-api-error.ts +1 -1
  67. package/src/api/query.ts +5 -5
  68. package/src/api/request-with-parameters.ts +6 -6
  69. package/src/client.ts +3 -3
  70. package/src/constants-internal.ts +5 -5
  71. package/src/constants.ts +28 -3
  72. package/src/deck/get-data-filter-extension-props.ts +164 -0
  73. package/src/deck/index.ts +1 -0
  74. package/src/filters/Filter.ts +179 -0
  75. package/src/filters/FilterTypes.ts +109 -0
  76. package/src/filters/geosjonFeatures.ts +32 -0
  77. package/src/filters/index.ts +6 -0
  78. package/src/filters/tileFeatures.ts +50 -0
  79. package/src/filters/tileFeaturesGeometries.ts +444 -0
  80. package/src/filters/tileFeaturesSpatialIndex.ts +119 -0
  81. package/src/filters.ts +4 -4
  82. package/src/geo.ts +12 -14
  83. package/src/index.ts +7 -0
  84. package/src/models/common.ts +11 -9
  85. package/src/models/index.ts +1 -1
  86. package/src/models/model.ts +3 -4
  87. package/src/operations/aggregation.ts +154 -0
  88. package/src/operations/applySorting.ts +109 -0
  89. package/src/operations/groupBy.ts +59 -0
  90. package/src/operations/groupByDate.ts +98 -0
  91. package/src/operations/histogram.ts +66 -0
  92. package/src/operations/index.ts +6 -0
  93. package/src/operations/scatterPlot.ts +50 -0
  94. package/src/sources/base-source.ts +8 -8
  95. package/src/sources/boundary-query-source.ts +2 -2
  96. package/src/sources/boundary-table-source.ts +2 -2
  97. package/src/sources/h3-query-source.ts +7 -5
  98. package/src/sources/h3-table-source.ts +7 -5
  99. package/src/sources/h3-tileset-source.ts +2 -2
  100. package/src/sources/index.ts +26 -26
  101. package/src/sources/quadbin-query-source.ts +7 -5
  102. package/src/sources/quadbin-table-source.ts +7 -5
  103. package/src/sources/quadbin-tileset-source.ts +2 -2
  104. package/src/sources/raster-source.ts +3 -2
  105. package/src/sources/types.ts +3 -3
  106. package/src/sources/vector-query-source.ts +7 -5
  107. package/src/sources/vector-table-source.ts +7 -5
  108. package/src/sources/vector-tileset-source.ts +2 -2
  109. package/src/spatial-index.ts +4 -5
  110. package/src/types-internal.ts +11 -5
  111. package/src/types.ts +73 -15
  112. package/src/utils/dateUtils.ts +28 -0
  113. package/src/utils/getTileFormat.ts +9 -0
  114. package/src/utils/makeIntervalComplete.ts +17 -0
  115. package/src/utils/transformTileCoordsToWGS84.ts +77 -0
  116. package/src/utils/transformToTileCoords.ts +85 -0
  117. package/src/utils.ts +3 -3
  118. package/src/widget-sources/index.ts +3 -1
  119. package/src/widget-sources/types.ts +39 -25
  120. package/src/widget-sources/widget-query-source.ts +12 -5
  121. package/src/widget-sources/{widget-base-source.ts → widget-remote-source.ts} +51 -171
  122. package/src/widget-sources/widget-source.ts +173 -0
  123. package/src/widget-sources/widget-table-source.ts +12 -5
  124. package/src/widget-sources/widget-tileset-source.ts +456 -0
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
- * @internalRemarks Source: @carto/react-core
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
- * @internalRemarks Source: @carto/react-core
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
- /** @internalRemarks Source: @carto/constants, @deck.gl/carto */
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
- * @internalRemarks Source: @deck.gl/carto
12
+ * @privateRemarks Source: @deck.gl/carto
13
13
  */
14
14
  export declare const DEFAULT_MAX_LENGTH_URL = 7000;
15
- /** @internalRemarks Source: @deck.gl/carto */
15
+ /** @privateRemarks Source: @deck.gl/carto */
16
16
  export declare const DEFAULT_TILE_RESOLUTION = 0.5;
17
17
  /**
18
- * @internalRemarks Source: @deck.gl/carto
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
- * @internalRemarks Source: @deck.gl/carto
23
+ * @privateRemarks Source: @deck.gl/carto
24
24
  * @internal
25
25
  */
26
26
  export declare const DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN = 6;
@@ -10,7 +10,7 @@
10
10
  * };
11
11
  * ```
12
12
  *
13
- * @internalRemarks Source: @carto/react-api, @deck.gl/carto
13
+ * @privateRemarks Source: @carto/react-api, @deck.gl/carto
14
14
  */
15
15
  export declare enum FilterType {
16
16
  IN = "in",
@@ -21,11 +21,33 @@ export declare enum FilterType {
21
21
  TIME = "time",
22
22
  STRING_SEARCH = "stringSearch"
23
23
  }
24
- /** @internalRemarks Source: @carto/constants */
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
- /** @internalRemarks Source: @carto/constants, @deck.gl/carto */
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
+ /** @privateRemarks Source: @carto/react-core */
33
+ export declare enum TileFormat {
34
+ MVT = "mvt",
35
+ JSON = "json",
36
+ GEOJSON = "geojson",
37
+ BINARY = "binary"
38
+ }
39
+ /** @privateRemarks Source: @carto/react-core */
40
+ export declare enum SpatialIndex {
41
+ H3 = "h3",
42
+ S2 = "s2",
43
+ QUADBIN = "quadbin"
44
+ }
45
+ /** @privateRemarks Source: @carto/react-core */
46
+ export declare enum Provider {
47
+ BIGQUERY = "bigquery",
48
+ REDSHIFT = "redshift",
49
+ POSTGRES = "postgres",
50
+ SNOWFLAKE = "snowflake",
51
+ DATABRICKS = "databricks",
52
+ DATABRICKS_REST = "databricksRest"
53
+ }
@@ -0,0 +1,28 @@
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. Requires that DataFilterExtension is initialized with
13
+ * filterSize=4, where the CARTO filters will occupy the first two slots.
14
+ *
15
+ * @example To create a deck.gl layer with GPU data filtering:
16
+ * ```typescript
17
+ * import {DataFilterExtension} from '@deck.gl/extensions';
18
+ * import {VectorTileLayer} from '@deck.gl/layers';
19
+ * import {getDataFilterExtensionProps} from '@carto/api-client';
20
+ *
21
+ * const layer = new VectorTileLayer({
22
+ * data: data,
23
+ * extensions: [new DataFilterExtension({filterSize: 4})],
24
+ * ...getDataFilterExtensionProps(filters),
25
+ * });
26
+ * ```
27
+ */
28
+ export declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
@@ -0,0 +1 @@
1
+ export * from './get-data-filter-extension-props.js';
@@ -0,0 +1,25 @@
1
+ import { FilterLogicalOperator, Filters } from '../types.js';
2
+ import { Feature } from 'geojson';
3
+ import { FeatureData } from '../types-internal.js';
4
+ import { BinaryFeature } from '@loaders.gl/schema';
5
+ /**
6
+ * @internal
7
+ * @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
8
+ */
9
+ export declare function _buildFeatureFilter({ filters, type, filtersLogicalOperator, }: {
10
+ filters?: Filters;
11
+ type?: 'number' | 'boolean';
12
+ filtersLogicalOperator?: FilterLogicalOperator;
13
+ }): (feature: Feature | FeatureData) => number | boolean;
14
+ /**
15
+ * Apply certain filters to a collection of features.
16
+ * @internal
17
+ */
18
+ export declare function applyFilters(features: FeatureData[], filters: Filters, filtersLogicalOperator: FilterLogicalOperator): FeatureData[];
19
+ /**
20
+ * Binary.
21
+ * @internal
22
+ */
23
+ export declare function buildBinaryFeatureFilter({ filters }: {
24
+ filters: Filters;
25
+ }): (() => number) | ((featureIdIdx: number, binaryData: BinaryFeature) => boolean);
@@ -0,0 +1,3 @@
1
+ import { FilterType } from '../constants.js';
2
+ export type FilterFunction = (filterValues: unknown[], featureValue: unknown, params?: Record<string, unknown>) => boolean;
3
+ export declare const filterFunctions: Record<FilterType, FilterFunction>;
@@ -0,0 +1,8 @@
1
+ import { FeatureCollection } from 'geojson';
2
+ import { FeatureData } from '../types-internal.js';
3
+ import { SpatialFilter } from '../types.js';
4
+ export declare function geojsonFeatures({ geojson, spatialFilter, uniqueIdProperty, }: {
5
+ geojson: FeatureCollection;
6
+ spatialFilter: SpatialFilter;
7
+ uniqueIdProperty?: string;
8
+ }): FeatureData[];
@@ -0,0 +1,6 @@
1
+ export * from './Filter.js';
2
+ export * from './FilterTypes.js';
3
+ export * from './geosjonFeatures.js';
4
+ export * from './tileFeatures.js';
5
+ export * from './tileFeaturesGeometries.js';
6
+ export * from './tileFeaturesSpatialIndex.js';
@@ -0,0 +1,20 @@
1
+ import { SpatialFilter, Tile } from '../types.js';
2
+ import { TileFormat } from '../constants.js';
3
+ import { FeatureData } from '../types-internal.js';
4
+ import { SpatialDataType } from '../sources/types.js';
5
+ /** @privateRemarks Source: @carto/react-core */
6
+ export type TileFeatures = {
7
+ tiles: Tile[];
8
+ tileFormat: TileFormat;
9
+ spatialDataType: SpatialDataType;
10
+ spatialDataColumn?: string;
11
+ spatialFilter: SpatialFilter;
12
+ uniqueIdProperty?: string;
13
+ options?: TileFeatureExtractOptions;
14
+ };
15
+ /** @privateRemarks Source: @carto/react-core */
16
+ export type TileFeatureExtractOptions = {
17
+ storeGeometry?: boolean;
18
+ };
19
+ /** @privateRemarks Source: @carto/react-core */
20
+ export declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
@@ -0,0 +1,13 @@
1
+ import { TileFormat } from '../constants.js';
2
+ import { SpatialFilter, Tile } from '../types.js';
3
+ import { FeatureData } from '../types-internal.js';
4
+ export declare const FEATURE_GEOM_PROPERTY = "__geomValue";
5
+ export declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
6
+ tiles: Tile[];
7
+ tileFormat?: TileFormat;
8
+ spatialFilter: SpatialFilter;
9
+ uniqueIdProperty?: string;
10
+ options?: {
11
+ storeGeometry?: boolean;
12
+ };
13
+ }): FeatureData[];
@@ -0,0 +1,10 @@
1
+ import { SpatialFilter, SpatialIndexTile } from '../types.js';
2
+ import { FeatureData } from '../types-internal.js';
3
+ import { SpatialDataType } from '../sources/types.js';
4
+ export type TileFeaturesSpatialIndexOptions = {
5
+ tiles: SpatialIndexTile[];
6
+ spatialFilter: SpatialFilter;
7
+ spatialDataColumn: string;
8
+ spatialDataType: SpatialDataType;
9
+ };
10
+ export declare function tileFeaturesSpatialIndex({ tiles, spatialFilter, spatialDataColumn, spatialDataType, }: TileFeaturesSpatialIndexOptions): FeatureData[];
@@ -1,5 +1,5 @@
1
- import { FilterType } from './constants';
2
- import { Filter } from './types';
1
+ import { FilterType } from './constants.js';
2
+ import { Filter } from './types.js';
3
3
  type FilterTypeOptions<T extends FilterType> = {
4
4
  type: T;
5
5
  column: string;
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';
@@ -9,3 +10,7 @@ export { APIErrorContext, APIRequestType, CartoAPIError, QueryOptions, buildPubl
9
10
  buildStatsUrl, // Internal, but required for fetchMap().
10
11
  query, requestWithParameters, } from './api/index.js';
11
12
  export { _getHexagonResolution } from './spatial-index.js';
13
+ export * from './filters/index.js';
14
+ export * from './operations/index.js';
15
+ export * from './utils/makeIntervalComplete.js';
16
+ export * from './utils/transformToTileCoords.js';
@@ -1,7 +1,8 @@
1
- /** @internalRemarks Source: @carto/react-api */
1
+ /** @privateRemarks Source: @carto/react-api */
2
2
  export interface ModelRequestOptions {
3
3
  method: 'GET' | 'POST';
4
- abortController?: AbortController;
4
+ headers?: Record<string, string>;
5
+ signal?: AbortSignal;
5
6
  otherOptions?: Record<string, unknown>;
6
7
  body?: string;
7
8
  }
@@ -12,13 +13,13 @@ interface ModelErrorResponse {
12
13
  }
13
14
  /**
14
15
  * Return more descriptive error from API
15
- * @internalRemarks Source: @carto/react-api
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
- /** @internalRemarks Source: @carto/react-api */
22
+ /** @privateRemarks Source: @carto/react-api */
22
23
  export declare function makeCall({ url, accessToken, opts, }: {
23
24
  url: string;
24
25
  accessToken: string;
@@ -1,3 +1,3 @@
1
1
  export { executeModel } from './model.js';
2
- export type { Model } from './model.js';
2
+ export type { Model, ModelSource } from './model.js';
3
3
  export type { ModelRequestOptions } from './common.js';
@@ -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
- /** @internalRemarks Source: @carto/react-api */
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
- * @internalRemarks Source: @carto/react-api
29
+ * @privateRemarks Source: @carto/react-api
30
30
  */
31
31
  export declare function executeModel(props: {
32
32
  model: Model;
@@ -0,0 +1,8 @@
1
+ import { AggregationType } from '../types.js';
2
+ import { FeatureData } from '../types-internal.js';
3
+ /** @privateRemarks Source: @carto/react-core */
4
+ export type AggregationFunction = (values: unknown[] | FeatureData[], keys?: string[] | string, joinOperation?: AggregationType) => number;
5
+ /** @privateRemarks Source: @carto/react-core */
6
+ export declare const aggregationFunctions: Record<Exclude<AggregationType, 'custom'>, AggregationFunction>;
7
+ /** @privateRemarks Source: @carto/react-core */
8
+ export declare function aggregate(feature: FeatureData, keys?: string[], operation?: AggregationType): unknown;
@@ -0,0 +1,20 @@
1
+ import { SortDirection } from '../types.js';
2
+ import { FeatureData } from '../types-internal.js';
3
+ type SortColumns = string | string[] | object[];
4
+ interface SortOptions {
5
+ sortBy?: SortColumns;
6
+ sortByDirection?: SortDirection;
7
+ sortByColumnType?: 'number' | 'string' | 'date';
8
+ }
9
+ /**
10
+ * Apply sort structure to a collection of features
11
+ * @param features
12
+ * @param [sortOptions]
13
+ * @param [sortOptions.sortBy] - One or more columns to sort by
14
+ * @param [sortOptions.sortByDirection] - Direction by the columns will be sorted
15
+ * @param [sortOptions.sortByColumnType] - Column type
16
+ * @internal
17
+ * @privateRemarks Source: @carto/react-core
18
+ */
19
+ export declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
20
+ export {};
@@ -0,0 +1,15 @@
1
+ import { AggregationType } from '../types.js';
2
+ import { FeatureData } from '../types-internal.js';
3
+ /** @privateRemarks Source: @carto/react-core */
4
+ export type GroupByFeature = {
5
+ name: string;
6
+ value: number;
7
+ }[];
8
+ /** @privateRemarks Source: @carto/react-core */
9
+ export declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, }: {
10
+ data: FeatureData[];
11
+ valuesColumns?: string[];
12
+ joinOperation?: AggregationType;
13
+ keysColumn: string;
14
+ operation: AggregationType;
15
+ }): GroupByFeature | null;
@@ -0,0 +1,11 @@
1
+ import { AggregationType, GroupDateType } from '../types.js';
2
+ import { GroupByFeature } from './groupBy.js';
3
+ /** @privateRemarks Source: @carto/react-core */
4
+ export declare function groupValuesByDateColumn({ data, valuesColumns, joinOperation, keysColumn, groupType, operation, }: {
5
+ data: Record<string, unknown>[];
6
+ valuesColumns?: string[];
7
+ joinOperation?: Exclude<AggregationType, 'custom'>;
8
+ keysColumn: string;
9
+ groupType: GroupDateType;
10
+ operation?: Exclude<AggregationType, 'custom'>;
11
+ }): GroupByFeature | null;
@@ -0,0 +1,13 @@
1
+ import { AggregationType } from '../types.js';
2
+ import { FeatureData } from '../types-internal.js';
3
+ /**
4
+ * Histogram computation.
5
+ * @privateRemarks Source: @carto/react-core
6
+ */
7
+ export declare function histogram({ data, valuesColumns, joinOperation, ticks, operation, }: {
8
+ data: FeatureData[];
9
+ valuesColumns?: string[];
10
+ joinOperation?: Exclude<AggregationType, 'custom'>;
11
+ ticks: number[];
12
+ operation: Exclude<AggregationType, 'custom'>;
13
+ }): number[];
@@ -0,0 +1,6 @@
1
+ export * from './aggregation.js';
2
+ export * from './applySorting.js';
3
+ export * from './groupBy.js';
4
+ export * from './groupByDate.js';
5
+ export * from './histogram.js';
6
+ export * from './scatterPlot.js';
@@ -0,0 +1,14 @@
1
+ import { FeatureData } from '../types-internal.js';
2
+ import { AggregationType } from '../types.js';
3
+ export type ScatterPlotFeature = [number, number][];
4
+ /**
5
+ * Filters invalid features and formats data.
6
+ * @privateRemarks Source: @carto/react-core
7
+ */
8
+ export declare function scatterPlot({ data, xAxisColumns, xAxisJoinOperation, yAxisColumns, yAxisJoinOperation, }: {
9
+ data: FeatureData[];
10
+ xAxisColumns: string[];
11
+ xAxisJoinOperation?: AggregationType;
12
+ yAxisColumns: string[];
13
+ yAxisJoinOperation?: AggregationType;
14
+ }): ScatterPlotFeature;
@@ -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,4 +1,4 @@
1
- import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
1
+ import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
2
2
  export type H3TilesetSourceOptions = SourceOptions & TilesetSourceOptions;
3
3
  export type H3TilesetSourceResponse = TilejsonResult;
4
4
  export declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
@@ -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, RasterSourceResponse } 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,4 +1,4 @@
1
- import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
1
+ import type { SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
2
2
  export type QuadbinTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
3
3
  export type QuadbinTilesetSourceResponse = TilejsonResult;
4
4
  export declare const quadbinTilesetSource: (options: QuadbinTilesetSourceOptions) => Promise<QuadbinTilesetSourceResponse>;
@@ -1,4 +1,4 @@
1
- import type { FilterOptions, SourceOptions, TilejsonResult, TilesetSourceOptions } from './types';
1
+ import type { FilterOptions, SourceOptions, TilejsonResult, TilesetSourceOptions } from './types.js';
2
2
  export type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
3
3
  export type RasterSourceResponse = TilejsonResult;
4
4
  export declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
@@ -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
- * @internalRemarks Source: cloud-native maps-api
181
+ * @privateRemarks Source: cloud-native maps-api
182
182
  * */
183
183
  export type SpatialFilterPolyfillMode = 'center' | 'intersects' | 'contains';
184
184
  export type TilejsonMapInstantiation = MapInstantiation & {
@@ -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,4 +1,4 @@
1
- import type { SourceOptions, TilesetSourceOptions, TilejsonResult } from './types';
1
+ import type { SourceOptions, TilesetSourceOptions, TilejsonResult } from './types.js';
2
2
  export type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
3
3
  export type VectorTilesetSourceResponse = TilejsonResult;
4
4
  export declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
@@ -1,6 +1,6 @@
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
6
  * Resolution conversion function. Takes a WebMercatorViewport and returns