@deck.gl/carto 9.0.0-alpha.6 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/cartoRasterTile-worker.js +4 -14
  2. package/dist/cartoSpatialTile-worker.js +4 -14
  3. package/dist/cartoVectorTile-worker.js +4 -14
  4. package/dist/dist.dev.js +50 -35
  5. package/dist/es5/api/endpoints.js +41 -20
  6. package/dist/es5/api/endpoints.js.map +1 -1
  7. package/dist/es5/api/fetch-map.js +16 -18
  8. package/dist/es5/api/fetch-map.js.map +1 -1
  9. package/dist/es5/api/layer-map.js +1 -1
  10. package/dist/es5/api/layer-map.js.map +1 -1
  11. package/dist/es5/api/query.js +10 -7
  12. package/dist/es5/api/query.js.map +1 -1
  13. package/dist/es5/api/request-with-parameters.js +1 -1
  14. package/dist/es5/api/request-with-parameters.js.map +1 -1
  15. package/dist/es5/layers/schema/carto-raster-tile-loader.js +1 -1
  16. package/dist/es5/layers/schema/carto-raster-tile-loader.js.map +1 -1
  17. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +1 -1
  18. package/dist/es5/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  19. package/dist/es5/layers/schema/carto-vector-tile-loader.js +1 -1
  20. package/dist/es5/layers/schema/carto-vector-tile-loader.js.map +1 -1
  21. package/dist/es5/layers/utils.js +1 -1
  22. package/dist/es5/layers/utils.js.map +1 -1
  23. package/dist/es5/sources/base-source.js.map +1 -1
  24. package/dist/esm/api/endpoints.js +30 -17
  25. package/dist/esm/api/endpoints.js.map +1 -1
  26. package/dist/esm/api/fetch-map.js +12 -14
  27. package/dist/esm/api/fetch-map.js.map +1 -1
  28. package/dist/esm/api/layer-map.js +1 -1
  29. package/dist/esm/api/layer-map.js.map +1 -1
  30. package/dist/esm/api/query.js +6 -4
  31. package/dist/esm/api/query.js.map +1 -1
  32. package/dist/esm/api/request-with-parameters.js +1 -1
  33. package/dist/esm/api/request-with-parameters.js.map +1 -1
  34. package/dist/esm/layers/schema/carto-raster-tile-loader.js +1 -1
  35. package/dist/esm/layers/schema/carto-raster-tile-loader.js.map +1 -1
  36. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +1 -1
  37. package/dist/esm/layers/schema/carto-spatial-tile-loader.js.map +1 -1
  38. package/dist/esm/layers/schema/carto-vector-tile-loader.js +1 -1
  39. package/dist/esm/layers/schema/carto-vector-tile-loader.js.map +1 -1
  40. package/dist/esm/layers/utils.js +1 -1
  41. package/dist/esm/layers/utils.js.map +1 -1
  42. package/dist/esm/sources/base-source.js.map +1 -1
  43. package/dist.min.js +39 -39
  44. package/package.json +10 -10
  45. package/src/.DS_Store +0 -0
  46. package/src/api/endpoints.ts +48 -17
  47. package/src/api/fetch-map.ts +13 -18
  48. package/src/api/layer-map.ts +3 -1
  49. package/src/api/query.ts +8 -4
  50. package/src/api/request-with-parameters.ts +1 -1
  51. package/src/layers/utils.ts +1 -1
  52. package/src/sources/base-source.ts +0 -1
  53. package/src/sources/types.ts +87 -3
  54. package/typed/api/endpoints.d.ts +17 -6
  55. package/typed/api/endpoints.d.ts.map +1 -1
  56. package/typed/api/fetch-map.d.ts +2 -3
  57. package/typed/api/fetch-map.d.ts.map +1 -1
  58. package/typed/api/layer-map.d.ts +1 -1
  59. package/typed/api/layer-map.d.ts.map +1 -1
  60. package/typed/api/query.d.ts +1 -1
  61. package/typed/api/query.d.ts.map +1 -1
  62. package/typed/api/types.d.ts +19 -19
  63. package/typed/api/types.d.ts.map +1 -1
  64. package/typed/layers/h3-tile-layer.d.ts +2 -2
  65. package/typed/layers/h3-tile-layer.d.ts.map +1 -1
  66. package/typed/layers/h3-tileset-2d.d.ts +1 -1
  67. package/typed/layers/h3-tileset-2d.d.ts.map +1 -1
  68. package/typed/layers/point-label-layer.d.ts +2 -2
  69. package/typed/layers/point-label-layer.d.ts.map +1 -1
  70. package/typed/layers/quadbin-layer.d.ts +2 -2
  71. package/typed/layers/quadbin-layer.d.ts.map +1 -1
  72. package/typed/layers/quadbin-tile-layer.d.ts +2 -2
  73. package/typed/layers/quadbin-tile-layer.d.ts.map +1 -1
  74. package/typed/layers/quadbin-tileset-2d.d.ts +1 -1
  75. package/typed/layers/quadbin-tileset-2d.d.ts.map +1 -1
  76. package/typed/layers/raster-layer.d.ts +2 -2
  77. package/typed/layers/raster-layer.d.ts.map +1 -1
  78. package/typed/layers/raster-tile-layer.d.ts +2 -2
  79. package/typed/layers/raster-tile-layer.d.ts.map +1 -1
  80. package/typed/layers/schema/carto-raster-tile-loader.d.ts +1 -1
  81. package/typed/layers/schema/carto-raster-tile-loader.d.ts.map +1 -1
  82. package/typed/layers/schema/spatialjson-utils.d.ts +8 -8
  83. package/typed/layers/schema/spatialjson-utils.d.ts.map +1 -1
  84. package/typed/layers/spatial-index-tile-layer.d.ts +2 -2
  85. package/typed/layers/spatial-index-tile-layer.d.ts.map +1 -1
  86. package/typed/layers/vector-tile-layer.d.ts +3 -3
  87. package/typed/layers/vector-tile-layer.d.ts.map +1 -1
  88. package/typed/sources/base-source.d.ts.map +1 -1
  89. package/typed/sources/boundary-query-source.d.ts +1 -1
  90. package/typed/sources/boundary-query-source.d.ts.map +1 -1
  91. package/typed/sources/boundary-table-source.d.ts +1 -1
  92. package/typed/sources/boundary-table-source.d.ts.map +1 -1
  93. package/typed/sources/h3-query-source.d.ts +1 -1
  94. package/typed/sources/h3-query-source.d.ts.map +1 -1
  95. package/typed/sources/h3-table-source.d.ts +1 -1
  96. package/typed/sources/h3-table-source.d.ts.map +1 -1
  97. package/typed/sources/h3-tileset-source.d.ts +1 -1
  98. package/typed/sources/h3-tileset-source.d.ts.map +1 -1
  99. package/typed/sources/quadbin-query-source.d.ts +1 -1
  100. package/typed/sources/quadbin-query-source.d.ts.map +1 -1
  101. package/typed/sources/quadbin-table-source.d.ts +1 -1
  102. package/typed/sources/quadbin-table-source.d.ts.map +1 -1
  103. package/typed/sources/quadbin-tileset-source.d.ts +1 -1
  104. package/typed/sources/quadbin-tileset-source.d.ts.map +1 -1
  105. package/typed/sources/raster-source.d.ts +1 -1
  106. package/typed/sources/raster-source.d.ts.map +1 -1
  107. package/typed/sources/types.d.ts +91 -16
  108. package/typed/sources/types.d.ts.map +1 -1
  109. package/typed/sources/vector-query-source.d.ts +1 -1
  110. package/typed/sources/vector-query-source.d.ts.map +1 -1
  111. package/typed/sources/vector-table-source.d.ts +1 -1
  112. package/typed/sources/vector-table-source.d.ts.map +1 -1
  113. package/typed/sources/vector-tileset-source.d.ts +1 -1
  114. package/typed/sources/vector-tileset-source.d.ts.map +1 -1
  115. package/typed/style/palette.d.ts +1 -1
  116. package/typed/style/palette.d.ts.map +1 -1
  117. package/typed/style/utils.d.ts +1 -1
  118. package/typed/style/utils.d.ts.map +1 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/carto",
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
- "version": "9.0.0-alpha.6",
5
+ "version": "9.0.0-beta.1",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -36,12 +36,12 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@babel/runtime": "^7.0.0",
39
- "@loaders.gl/gis": "4.0.3",
40
- "@loaders.gl/loader-utils": "4.0.3",
41
- "@loaders.gl/mvt": "4.0.3",
42
- "@loaders.gl/tiles": "4.0.3",
43
- "@luma.gl/constants": "9.0.0-alpha.42",
44
- "@luma.gl/core": "9.0.0-alpha.42",
39
+ "@loaders.gl/gis": "4.1.0-alpha.9",
40
+ "@loaders.gl/loader-utils": "4.1.0-alpha.9",
41
+ "@loaders.gl/mvt": "4.1.0-alpha.9",
42
+ "@loaders.gl/tiles": "4.1.0-alpha.9",
43
+ "@luma.gl/constants": "9.0.0-alpha.54",
44
+ "@luma.gl/core": "9.0.0-alpha.54",
45
45
  "@math.gl/web-mercator": "^4.0.0",
46
46
  "cartocolor": "^4.0.2",
47
47
  "d3-array": "^3.2.0",
@@ -54,7 +54,7 @@
54
54
  "quadbin": "^0.1.9"
55
55
  },
56
56
  "devDependencies": {
57
- "@loaders.gl/schema": "4.0.3",
57
+ "@loaders.gl/schema": "4.1.0-alpha.9",
58
58
  "@types/d3-array": "^3.0.2",
59
59
  "@types/d3-color": "^1.4.2",
60
60
  "@types/d3-scale": "^3.0.0"
@@ -65,7 +65,7 @@
65
65
  "@deck.gl/extensions": "^9.0.0-alpha",
66
66
  "@deck.gl/geo-layers": "^9.0.0-alpha",
67
67
  "@deck.gl/layers": "^9.0.0-alpha",
68
- "@loaders.gl/core": "4.0.3"
68
+ "@loaders.gl/core": "4.1.0-alpha.9"
69
69
  },
70
- "gitHead": "dcb297a8b2b0fcfb3194f16f8df759afcd0e6cac"
70
+ "gitHead": "9628417918bec5cc73c1345bfcd2f2be575741f1"
71
71
  }
package/src/.DS_Store ADDED
Binary file
@@ -2,37 +2,68 @@ import {MapType} from './types';
2
2
 
3
3
  export type V3Endpoint = 'maps' | 'stats' | 'sql';
4
4
 
5
- function buildUrlFromBase(apiBaseUrl: string, endpoint: V3Endpoint) {
6
- let suffix = `/v3/${endpoint}`;
7
- if (apiBaseUrl.endsWith('/')) {
8
- suffix = suffix.substring(1);
9
- }
10
-
11
- return `${apiBaseUrl}${suffix}`;
5
+ function joinPath(...args: string[]): string {
6
+ return args.map(part => (part.endsWith('/') ? part.slice(0, -1) : part)).join('/');
12
7
  }
13
8
 
14
- export function buildMapsUrlFromBase(apiBaseUrl: string): string {
15
- return buildUrlFromBase(apiBaseUrl, 'maps');
9
+ function buildV3Path(
10
+ apiBaseUrl: string,
11
+ version: 'v3',
12
+ endpoint: V3Endpoint,
13
+ ...rest: string[]
14
+ ): string {
15
+ return joinPath(apiBaseUrl, version, endpoint, ...rest);
16
16
  }
17
17
 
18
- export function buildStatsUrlFromBase(apiBaseUrl: string): string {
19
- return buildUrlFromBase(apiBaseUrl, 'stats');
18
+ export function buildPublicMapUrl({
19
+ apiBaseUrl,
20
+ cartoMapId
21
+ }: {
22
+ apiBaseUrl: string;
23
+ cartoMapId: string;
24
+ }): string {
25
+ return buildV3Path(apiBaseUrl, 'v3', 'maps', 'public', cartoMapId);
20
26
  }
21
27
 
22
- export function buildQueryUrlFromBase(apiBaseUrl: string): string {
23
- return buildUrlFromBase(apiBaseUrl, 'sql');
28
+ export function buildStatsUrl({
29
+ attribute,
30
+ apiBaseUrl,
31
+ connectionName,
32
+ source,
33
+ type
34
+ }: {
35
+ attribute: string;
36
+ apiBaseUrl: string;
37
+ connectionName: string;
38
+ source: string;
39
+ type: MapType;
40
+ }): string {
41
+ if (type === 'query') {
42
+ return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, attribute);
43
+ }
44
+
45
+ // type === 'table'
46
+ return buildV3Path(apiBaseUrl, 'v3', 'stats', connectionName, source, attribute);
24
47
  }
25
48
 
26
49
  export function buildSourceUrl({
27
50
  apiBaseUrl,
28
51
  connectionName,
29
- endpoint,
30
- mapsUrl
52
+ endpoint
31
53
  }: {
32
54
  apiBaseUrl: string;
33
55
  connectionName: string;
34
56
  endpoint: MapType;
35
- mapsUrl?: string;
36
57
  }): string {
37
- return `${mapsUrl || buildMapsUrlFromBase(apiBaseUrl)}/${connectionName}/${endpoint}`;
58
+ return buildV3Path(apiBaseUrl, 'v3', 'maps', connectionName, endpoint);
59
+ }
60
+
61
+ export function buildQueryUrl({
62
+ apiBaseUrl,
63
+ connectionName
64
+ }: {
65
+ apiBaseUrl: string;
66
+ connectionName: string;
67
+ }): string {
68
+ return buildV3Path(apiBaseUrl, 'v3', 'sql', connectionName, 'query');
38
69
  }
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import {CartoAPIError} from './carto-api-error';
6
6
  import {DEFAULT_API_BASE_URL, DEFAULT_CLIENT} from './common';
7
- import {buildMapsUrlFromBase, buildStatsUrlFromBase} from './endpoints';
7
+ import {buildPublicMapUrl, buildStatsUrl} from './endpoints';
8
8
  import {
9
9
  GeojsonResult,
10
10
  JsonResult,
@@ -108,26 +108,23 @@ async function _fetchMapDataset(
108
108
  }
109
109
 
110
110
  async function _fetchTilestats(
111
- attribute,
111
+ attribute: string,
112
112
  dataset: Dataset,
113
113
  accessToken: string,
114
114
  apiBaseUrl: string
115
115
  ) {
116
- const {connectionName: connection, data, id, source, type, queryParameters} = dataset;
117
- const errorContext: APIErrorContext = {requestType: 'Tile stats', connection, type, source};
116
+ const {connectionName, data, id, source, type, queryParameters} = dataset;
117
+ const errorContext: APIErrorContext = {
118
+ requestType: 'Tile stats',
119
+ connection: connectionName,
120
+ type,
121
+ source
122
+ };
118
123
  if (!('tilestats' in data)) {
119
124
  throw new CartoAPIError(new Error(`Invalid dataset for tilestats: ${id}`), errorContext);
120
125
  }
121
126
 
122
- const statsUrl = buildStatsUrlFromBase(apiBaseUrl);
123
- let baseUrl = `${statsUrl}/${connection}/`;
124
- if (type === 'query') {
125
- baseUrl += attribute;
126
- } else {
127
- // MAP_TYPE.TABLE
128
- baseUrl += `${source}/${attribute}`;
129
- }
130
-
127
+ const baseUrl = buildStatsUrl({attribute, apiBaseUrl, ...dataset});
131
128
  const headers = {Authorization: `Bearer ${accessToken}`};
132
129
  const parameters: Record<string, string> = {};
133
130
  if (type === 'query') {
@@ -166,7 +163,7 @@ async function fillInTileStats(
166
163
  {datasets, keplerMapConfig, token}: {datasets: Dataset[]; keplerMapConfig: any; token: string},
167
164
  apiBaseUrl: string
168
165
  ) {
169
- const attributes: {attribute?: string; dataset?: any}[] = [];
166
+ const attributes: {attribute: string; dataset: any}[] = [];
170
167
  const {layers} = keplerMapConfig.config.visState;
171
168
  for (const layer of layers) {
172
169
  for (const channel of Object.keys(layer.visualChannels)) {
@@ -181,7 +178,7 @@ async function fillInTileStats(
181
178
  }
182
179
  }
183
180
  // Remove duplicates to avoid repeated requests
184
- const filteredAttributes: {attribute?: string; dataset?: any}[] = [];
181
+ const filteredAttributes: {attribute: string; dataset: any}[] = [];
185
182
  for (const a of attributes) {
186
183
  if (
187
184
  !filteredAttributes.find(
@@ -203,7 +200,6 @@ export type FetchMapOptions = {
203
200
  cartoMapId: string;
204
201
  clientId?: string;
205
202
  headers?: Record<string, string>;
206
- mapsUrl?: string;
207
203
  autoRefresh?: number;
208
204
  onNewData?: (map: any) => void;
209
205
  };
@@ -214,7 +210,6 @@ export async function fetchMap({
214
210
  cartoMapId,
215
211
  clientId = DEFAULT_CLIENT,
216
212
  headers = {},
217
- mapsUrl,
218
213
  autoRefresh,
219
214
  onNewData
220
215
  }: FetchMapOptions) {
@@ -230,7 +225,7 @@ export async function fetchMap({
230
225
  );
231
226
  }
232
227
 
233
- const baseUrl = `${mapsUrl || buildMapsUrlFromBase(apiBaseUrl)}/public/${cartoMapId}`;
228
+ const baseUrl = buildPublicMapUrl({apiBaseUrl, cartoMapId});
234
229
  const errorContext: APIErrorContext = {requestType: 'Public map', mapId: cartoMapId};
235
230
  const map = await requestWithParameters({baseUrl, headers, errorContext});
236
231
 
@@ -243,7 +243,9 @@ function domainFromAttribute(attribute, scaleType: SCALE_TYPE, scaleLength: numb
243
243
  }
244
244
 
245
245
  if (scaleType === 'quantile' && attribute.quantiles) {
246
- return attribute.quantiles[scaleLength];
246
+ return attribute.quantiles.global
247
+ ? attribute.quantiles.global[scaleLength]
248
+ : attribute.quantiles[scaleLength];
247
249
  }
248
250
 
249
251
  let {min} = attribute;
package/src/api/query.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import {SOURCE_DEFAULTS} from '../sources';
2
2
  import type {SourceOptions, QuerySourceOptions, QueryResult} from '../sources/types';
3
- import {buildQueryUrlFromBase} from './endpoints';
3
+ import {buildQueryUrl} from './endpoints';
4
4
  import {requestWithParameters} from './request-with-parameters';
5
5
  import {APIErrorContext} from './types';
6
6
 
@@ -8,15 +8,19 @@ export type QueryOptions = SourceOptions & Omit<QuerySourceOptions, 'spatialData
8
8
  type UrlParameters = {q: string; queryParameters?: string};
9
9
 
10
10
  export const query = async function (options: QueryOptions): Promise<QueryResult> {
11
- const {apiBaseUrl, connectionName, sqlQuery, queryParameters} = options;
11
+ const {
12
+ apiBaseUrl = SOURCE_DEFAULTS.apiBaseUrl,
13
+ connectionName,
14
+ sqlQuery,
15
+ queryParameters
16
+ } = options;
12
17
  const urlParameters: UrlParameters = {q: sqlQuery};
13
18
 
14
19
  if (queryParameters) {
15
20
  urlParameters.queryParameters = JSON.stringify(queryParameters);
16
21
  }
17
22
 
18
- const queryUrl = buildQueryUrlFromBase(apiBaseUrl || SOURCE_DEFAULTS.apiBaseUrl);
19
- const baseUrl = `${queryUrl}/${connectionName}/query`;
23
+ const baseUrl = buildQueryUrl({apiBaseUrl, connectionName});
20
24
  const headers = {Authorization: `Bearer ${options.accessToken}`, ...options.headers};
21
25
 
22
26
  const errorContext: APIErrorContext = {
@@ -42,7 +42,7 @@ export async function requestWithParameters<T = any>({
42
42
  /* global fetch */
43
43
  let response: Response;
44
44
  if (url.length > MAX_GET_LENGTH) {
45
- response = await fetch(url, {method: 'POST', body: JSON.stringify(parameters), headers});
45
+ response = await fetch(baseUrl, {method: 'POST', body: JSON.stringify(parameters), headers});
46
46
  } else {
47
47
  response = await fetch(url, {headers});
48
48
  }
@@ -20,7 +20,7 @@ export function mergeBoundaryData(geometry: VectorTile, properties: PropertiesTi
20
20
  const mapping = {};
21
21
  for (const {geoid, ...rest} of properties.properties) {
22
22
  if (geoid in mapping) {
23
- log.warn(`Duplicate geoid key in boundary mapping, using first occurance`)();
23
+ log.warn('Duplicate geoid key in boundary mapping, using first occurance')();
24
24
  } else {
25
25
  mapping[geoid] = rest;
26
26
  }
@@ -8,7 +8,6 @@ import type {
8
8
  JsonResult,
9
9
  SourceOptionalOptions,
10
10
  SourceRequiredOptions,
11
- Tilejson,
12
11
  TilejsonMapInstantiation,
13
12
  TilejsonResult
14
13
  } from './types';
@@ -2,40 +2,124 @@ import type {Feature} from 'geojson';
2
2
  import type {Format, MapInstantiation, QueryParameters} from '../api/types';
3
3
 
4
4
  export type SourceRequiredOptions = {
5
+ /** Carto platform access token. */
5
6
  accessToken: string;
7
+
8
+ /** Data warehouse connection name in Carto platform. */
6
9
  connectionName: string;
7
10
  };
8
11
 
9
12
  export type SourceOptionalOptions = {
13
+ /**
14
+ * Base URL of the CARTO Maps API.
15
+ *
16
+ * Example for account located in EU-west region: `https://gcp-eu-west1.api.carto.com`
17
+ *
18
+ * @default https://gcp-us-east1.api.carto.com
19
+ */
10
20
  apiBaseUrl: string;
21
+
22
+ /**
23
+ * Custom HTTP headers added to map instantiation and data requests.
24
+ */
25
+ headers: Record<string, string>;
26
+
27
+ /**
28
+ * Cache buster value returned by map instantiation.
29
+ *
30
+ * Carto source saves `cache` value of map instantiation response in `cache.value`, so it can be used to
31
+ * check if underlying map data has changed between distinct source requests.
32
+ */
11
33
  cache?: {value?: number};
34
+
12
35
  clientId: string;
13
36
  /** @deprecated use `query` instead **/
14
37
  format: Format;
15
- headers: Record<string, string>;
16
- mapsUrl?: string;
17
38
  };
18
39
 
19
40
  export type SourceOptions = SourceRequiredOptions & Partial<SourceOptionalOptions>;
20
41
 
21
42
  export type AggregationOptions = {
43
+ /**
44
+ * Defines the aggregation expressions that will be calculated from the resulting columns on each grid cell.
45
+ *
46
+ * Example:
47
+ *
48
+ * sum(pop) as total_population, avg(rev) as average_revenue
49
+ */
22
50
  aggregationExp: string;
51
+
52
+ /**
53
+ * Defines the tile aggregation resolution.
54
+ *
55
+ * @default 6 for quadbin and 4 for h3 sources
56
+ */
23
57
  aggregationResLevel?: number;
24
58
  };
25
59
 
26
60
  export type QuerySourceOptions = {
61
+ /**
62
+ * The column name and the type of geospatial support.
63
+ *
64
+ * If not present, defaults to `'geom'` for generic queries, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
65
+ */
27
66
  spatialDataColumn?: string;
67
+
68
+ /** SQL query. */
28
69
  sqlQuery: string;
70
+
71
+ /**
72
+ * Values for named or positional paramteres in the query.
73
+ *
74
+ * The way query parameters are determined by data warehouse.
75
+ *
76
+ * * BigQuery has named query parameters, specified with a dictionary, and referenced by key (`@key`)
77
+ *
78
+ * ```
79
+ * sqlQuery: "SELECT * FROM carto-demo-data.demo_tables.retail_stores WHERE storetype = ⁣@type AND revenue > ⁣@minRevenue"
80
+ * queryParameters: { type: 'Supermarket', minRevenue: 1000000 }
81
+ * ```
82
+ * * Snowflake supports positional parameters, in the form `:1`, `:2`, etc.
83
+ *
84
+ * ```
85
+ * sqlQuery: "SELECT * FROM demo_db.public.import_retail_stores WHERE storetype = :2 AND revenue > :1
86
+ * queryParameters: [100000, "Supermarket"]
87
+ * ```
88
+ * * Postgres and Redhisft supports positional parameters, but in the form `$1`, `$2`, etc.
89
+ *
90
+ * ```
91
+ * sqlQuery: "SELECT * FROM carto_demo_data.demo_tables.retail_stores WHERE storetype = $2 AND revenue > $1
92
+ * queryParameters: [100000, "Supermarket"]
93
+ * ```
94
+ */
29
95
  queryParameters?: QueryParameters;
30
96
  };
31
97
 
32
98
  export type TableSourceOptions = {
99
+ /**
100
+ * Fully qualified name of table.
101
+ */
102
+ tableName: string;
103
+
104
+ /**
105
+ * Columns to retrieve from the table.
106
+ *
107
+ * If not present, all columns are returned.
108
+ */
33
109
  columns?: string[];
110
+
111
+ /**
112
+ * The column name and the type of geospatial support.
113
+ *
114
+ * If not present, defaults to `'geom'` for generic tables, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
115
+ */
34
116
  spatialDataColumn?: string;
35
- tableName: string;
36
117
  };
37
118
 
38
119
  export type TilesetSourceOptions = {
120
+ /**
121
+ * Fully qualified name of tileset.
122
+ */
39
123
  tableName: string;
40
124
  };
41
125
 
@@ -1,12 +1,23 @@
1
1
  import { MapType } from './types';
2
- export declare type V3Endpoint = 'maps' | 'stats' | 'sql';
3
- export declare function buildMapsUrlFromBase(apiBaseUrl: string): string;
4
- export declare function buildStatsUrlFromBase(apiBaseUrl: string): string;
5
- export declare function buildQueryUrlFromBase(apiBaseUrl: string): string;
6
- export declare function buildSourceUrl({ apiBaseUrl, connectionName, endpoint, mapsUrl }: {
2
+ export type V3Endpoint = 'maps' | 'stats' | 'sql';
3
+ export declare function buildPublicMapUrl({ apiBaseUrl, cartoMapId }: {
4
+ apiBaseUrl: string;
5
+ cartoMapId: string;
6
+ }): string;
7
+ export declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source, type }: {
8
+ attribute: string;
9
+ apiBaseUrl: string;
10
+ connectionName: string;
11
+ source: string;
12
+ type: MapType;
13
+ }): string;
14
+ export declare function buildSourceUrl({ apiBaseUrl, connectionName, endpoint }: {
7
15
  apiBaseUrl: string;
8
16
  connectionName: string;
9
17
  endpoint: MapType;
10
- mapsUrl?: string;
18
+ }): string;
19
+ export declare function buildQueryUrl({ apiBaseUrl, connectionName }: {
20
+ apiBaseUrl: string;
21
+ connectionName: string;
11
22
  }): string;
12
23
  //# sourceMappingURL=endpoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,oBAAY,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAWlD,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,EACd,QAAQ,EACR,OAAO,EACR,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAET"}
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAelD,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAET;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,UAAU,EACV,cAAc,EACd,MAAM,EACN,IAAI,EACL,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,MAAM,CAOT;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,EACd,QAAQ,EACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAET;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,cAAc,EACf,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAET"}
@@ -1,13 +1,12 @@
1
- export declare type FetchMapOptions = {
1
+ export type FetchMapOptions = {
2
2
  apiBaseUrl?: string;
3
3
  cartoMapId: string;
4
4
  clientId?: string;
5
5
  headers?: Record<string, string>;
6
- mapsUrl?: string;
7
6
  autoRefresh?: number;
8
7
  onNewData?: (map: any) => void;
9
8
  };
10
- export declare function fetchMap({ apiBaseUrl, cartoMapId, clientId, headers, mapsUrl, autoRefresh, onNewData }: FetchMapOptions): Promise<{
9
+ export declare function fetchMap({ apiBaseUrl, cartoMapId, clientId, headers, autoRefresh, onNewData }: FetchMapOptions): Promise<{
11
10
  stopAutoRefresh: (() => void) | undefined;
12
11
  id: any;
13
12
  title: any;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-map.d.ts","sourceRoot":"","sources":["../../src/api/fetch-map.ts"],"names":[],"mappings":"AAwMA,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAGF,wBAAsB,QAAQ,CAAC,EAC7B,UAAiC,EACjC,UAAU,EACV,QAAyB,EACzB,OAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACV,EAAE,eAAe;4BAmBY,IAAI;;;;;;;;;;GAuDjC"}
1
+ {"version":3,"file":"fetch-map.d.ts","sourceRoot":"","sources":["../../src/api/fetch-map.ts"],"names":[],"mappings":"AAqMA,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAGF,wBAAsB,QAAQ,CAAC,EAC7B,UAAiC,EACjC,UAAU,EACV,QAAyB,EACzB,OAAY,EACZ,WAAW,EACX,SAAS,EACV,EAAE,eAAe;4BAmBY,IAAI;;;;;;;;;;GAuDjC"}
@@ -17,7 +17,7 @@ declare const SCALE_FUNCS: {
17
17
  custom: typeof scaleThreshold;
18
18
  identity: typeof scaleIdentity;
19
19
  };
20
- export declare type SCALE_TYPE = keyof typeof SCALE_FUNCS;
20
+ export type SCALE_TYPE = keyof typeof SCALE_FUNCS;
21
21
  export declare const AGGREGATION: {
22
22
  average: string;
23
23
  maximum: string;
@@ -1 +1 @@
1
- {"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAK/E,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAE5D,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAA4B,aAAa,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,kBAAkB,EAClB,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,QAAA,MAAM,WAAW;;;;;;;;;;CAUhB,CAAC;AACF,oBAAY,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAQlD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAuEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,UAAU,GAClB;IAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC;IAAC,YAAY,EAAE,GAAG,CAAA;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AkB,EAAE,IAAI,KAAA,OAMrE;AAED,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { SourceOptions, QuerySourceOptions, QueryResult } from '../sources/types';
2
- export declare type QueryOptions = SourceOptions & Omit<QuerySourceOptions, 'spatialDataColumn'>;
2
+ export type QueryOptions = SourceOptions & Omit<QuerySourceOptions, 'spatialDataColumn'>;
3
3
  export declare const query: (options: QueryOptions) => Promise<QueryResult>;
4
4
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/api/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAKrF,oBAAY,YAAY,GAAG,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAGzF,eAAO,MAAM,KAAK,YAA4B,YAAY,KAAG,QAAQ,WAAW,CAwB/E,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/api/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAKrF,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAGzF,eAAO,MAAM,KAAK,YAA4B,YAAY,KAAG,QAAQ,WAAW,CA4B/E,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { SCALE_TYPE } from './layer-map';
2
- export declare type Format = 'json' | 'geojson' | 'tilejson';
3
- export declare type MapType = 'boundary' | 'query' | 'table' | 'tileset' | 'raster';
4
- export declare type RequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL';
5
- export declare type APIErrorContext = {
2
+ export type Format = 'json' | 'geojson' | 'tilejson';
3
+ export type MapType = 'boundary' | 'query' | 'table' | 'tileset' | 'raster';
4
+ export type RequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL';
5
+ export type APIErrorContext = {
6
6
  requestType: RequestType;
7
7
  mapId?: string;
8
8
  connection?: string;
@@ -29,20 +29,20 @@ export interface MapInstantiation extends MapInstantiationFormats {
29
29
  size?: number;
30
30
  schema: SchemaField[];
31
31
  }
32
- declare type MapInstantiationFormats = Record<Format, {
32
+ type MapInstantiationFormats = Record<Format, {
33
33
  url: string[];
34
34
  error?: any;
35
35
  }>;
36
- export declare type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;
37
- export declare type NamedQueryParameter = Record<string, QueryParameterValue>;
38
- export declare type PositionalQueryParameter = QueryParameterValue[];
39
- export declare type QueryParameters = NamedQueryParameter | PositionalQueryParameter;
40
- export declare type VisualChannelField = {
36
+ export type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;
37
+ export type NamedQueryParameter = Record<string, QueryParameterValue>;
38
+ export type PositionalQueryParameter = QueryParameterValue[];
39
+ export type QueryParameters = NamedQueryParameter | PositionalQueryParameter;
40
+ export type VisualChannelField = {
41
41
  name: string;
42
42
  type: string;
43
43
  colorColumn?: string;
44
44
  };
45
- export declare type VisualChannels = {
45
+ export type VisualChannels = {
46
46
  colorField?: VisualChannelField;
47
47
  colorScale?: SCALE_TYPE;
48
48
  customMarkersField?: VisualChannelField;
@@ -58,21 +58,21 @@ export declare type VisualChannels = {
58
58
  heightField?: VisualChannelField;
59
59
  heightScale?: SCALE_TYPE;
60
60
  };
61
- export declare type ColorRange = {
61
+ export type ColorRange = {
62
62
  category: string;
63
63
  colors: string[];
64
64
  colorMap: string[][] | undefined;
65
65
  name: string;
66
66
  type: string;
67
67
  };
68
- export declare type CustomMarkersRange = {
68
+ export type CustomMarkersRange = {
69
69
  markerMap: {
70
70
  value: string;
71
71
  markerUrl?: string;
72
72
  }[];
73
73
  othersMarker?: string;
74
74
  };
75
- export declare type VisConfig = {
75
+ export type VisConfig = {
76
76
  filled?: boolean;
77
77
  opacity?: number;
78
78
  enable3d?: boolean;
@@ -91,7 +91,7 @@ export declare type VisConfig = {
91
91
  heightRange?: any;
92
92
  heightAggregation?: any;
93
93
  };
94
- export declare type TextLabel = {
94
+ export type TextLabel = {
95
95
  field: VisualChannelField | null | undefined;
96
96
  alignment?: 'center' | 'bottom' | 'top';
97
97
  anchor?: 'middle' | 'start' | 'end';
@@ -100,7 +100,7 @@ export declare type TextLabel = {
100
100
  offset?: [number, number];
101
101
  outlineColor?: number[];
102
102
  };
103
- export declare type MapLayerConfig = {
103
+ export type MapLayerConfig = {
104
104
  columns?: Record<string, any>;
105
105
  color?: number[];
106
106
  label?: string;
@@ -108,16 +108,16 @@ export declare type MapLayerConfig = {
108
108
  textLabel: TextLabel[];
109
109
  visConfig: VisConfig;
110
110
  };
111
- export declare type MapTextSubLayerConfig = Omit<MapLayerConfig, 'textLabel'> & {
111
+ export type MapTextSubLayerConfig = Omit<MapLayerConfig, 'textLabel'> & {
112
112
  textLabel?: TextLabel;
113
113
  };
114
- export declare type MapConfigLayer = {
114
+ export type MapConfigLayer = {
115
115
  type: string;
116
116
  id: string;
117
117
  config: MapLayerConfig;
118
118
  visualChannels: VisualChannels;
119
119
  };
120
- export declare type MapDataset = {
120
+ export type MapDataset = {
121
121
  id: string;
122
122
  data: any;
123
123
  aggregationExp: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAEvC,oBAAY,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AACrD,oBAAY,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC5E,oBAAY,WAAW,GAAG,UAAU,GAAG,mBAAmB,GAAG,YAAY,GAAG,YAAY,GAAG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AAS,CAAC;IAC7C,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG;IACtE,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,GAAG,CAAC;IACV,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -8,9 +8,9 @@ export declare const renderSubLayers: (props: any) => H3HexagonLayer<any, {
8
8
  highPrecision: true;
9
9
  }> | null;
10
10
  /** All properties supported by H3TileLayer. */
11
- export declare type H3TileLayerProps<DataT = unknown> = _H3TileLayerProps<DataT> & CompositeLayerProps;
11
+ export type H3TileLayerProps<DataT = unknown> = _H3TileLayerProps<DataT> & CompositeLayerProps;
12
12
  /** Properties added by H3TileLayer. */
13
- declare type _H3TileLayerProps<DataT> = Omit<H3HexagonLayerProps<DataT>, 'data'> & Omit<SpatialIndexTileLayerProps<DataT>, 'data'> & {
13
+ type _H3TileLayerProps<DataT> = Omit<H3HexagonLayerProps<DataT>, 'data'> & Omit<SpatialIndexTileLayerProps<DataT>, 'data'> & {
14
14
  data: null | TilejsonResult | Promise<TilejsonResult>;
15
15
  };
16
16
  export default class H3TileLayer<DataT = any, ExtraPropsT extends {} = {}> extends CompositeLayer<ExtraPropsT & Required<_H3TileLayerProps<DataT>>> {