@carto/api-client 0.5.19-alpha.radius-aggregation-1 → 0.5.20
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 +9 -2
- package/build/api-client.cjs +157 -129
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +77 -60
- package/build/api-client.d.ts +77 -60
- package/build/api-client.js +149 -124
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch-map/layer-map.ts +13 -3
- package/src/sources/index.ts +47 -14
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"homepage": "https://github.com/CartoDB/carto-api-client#readme",
|
|
9
9
|
"author": "Don McCurdy <donmccurdy@carto.com>",
|
|
10
10
|
"packageManager": "yarn@4.3.1",
|
|
11
|
-
"version": "0.5.
|
|
11
|
+
"version": "0.5.20",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
@@ -240,9 +240,19 @@ function domainFromAttribute(
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
if (scaleType === 'quantile' && attribute.quantiles) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
const quantiles: Record<number, number[]> =
|
|
244
|
+
'global' in attribute.quantiles
|
|
245
|
+
? attribute.quantiles.global
|
|
246
|
+
: attribute.quantiles;
|
|
247
|
+
|
|
248
|
+
// Stats API doesn't provide quantile[2] - which would be effecively [min, median, max]
|
|
249
|
+
// so let's derive median from Quartiles (quantile[4]), of which second is median
|
|
250
|
+
if (scaleLength === 2 && !quantiles[2] && quantiles[4]?.length === 5) {
|
|
251
|
+
return [quantiles[4][0], quantiles[4][2], quantiles[4][4]];
|
|
252
|
+
}
|
|
253
|
+
if (quantiles[scaleLength]) {
|
|
254
|
+
return quantiles[scaleLength];
|
|
255
|
+
}
|
|
246
256
|
}
|
|
247
257
|
|
|
248
258
|
let {min} = attribute;
|
package/src/sources/index.ts
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
// Import all source functions
|
|
6
|
+
import {boundaryQuerySource} from './boundary-query-source.js';
|
|
7
|
+
import {boundaryTableSource} from './boundary-table-source.js';
|
|
8
|
+
import {h3QuerySource} from './h3-query-source.js';
|
|
9
|
+
import {h3TableSource} from './h3-table-source.js';
|
|
10
|
+
import {h3TilesetSource} from './h3-tileset-source.js';
|
|
11
|
+
import {quadbinQuerySource} from './quadbin-query-source.js';
|
|
12
|
+
import {quadbinTableSource} from './quadbin-table-source.js';
|
|
13
|
+
import {quadbinTilesetSource} from './quadbin-tileset-source.js';
|
|
14
|
+
import {rasterSource} from './raster-source.js';
|
|
15
|
+
import {trajectoryQuerySource} from './trajectory-query-source.js';
|
|
16
|
+
import {trajectoryTableSource} from './trajectory-table-source.js';
|
|
17
|
+
import {vectorQuerySource} from './vector-query-source.js';
|
|
18
|
+
import {vectorTableSource} from './vector-table-source.js';
|
|
19
|
+
import {vectorTilesetSource} from './vector-tileset-source.js';
|
|
20
|
+
|
|
5
21
|
export {SOURCE_DEFAULTS} from './base-source.js';
|
|
6
22
|
export {RasterBandColorinterp} from './constants.js';
|
|
7
23
|
export type {
|
|
@@ -29,83 +45,100 @@ export type {
|
|
|
29
45
|
RasterBandType,
|
|
30
46
|
} from './types.js';
|
|
31
47
|
|
|
32
|
-
export {boundaryQuerySource}
|
|
48
|
+
export {boundaryQuerySource};
|
|
33
49
|
export type {
|
|
34
50
|
BoundaryQuerySourceOptions,
|
|
35
51
|
BoundaryQuerySourceResponse,
|
|
36
52
|
} from './boundary-query-source.js';
|
|
37
53
|
|
|
38
|
-
export {boundaryTableSource}
|
|
54
|
+
export {boundaryTableSource};
|
|
39
55
|
export type {
|
|
40
56
|
BoundaryTableSourceOptions,
|
|
41
57
|
BoundaryTableSourceResponse,
|
|
42
58
|
} from './boundary-table-source.js';
|
|
43
59
|
|
|
44
|
-
export {h3QuerySource}
|
|
60
|
+
export {h3QuerySource};
|
|
45
61
|
export type {
|
|
46
62
|
H3QuerySourceOptions,
|
|
47
63
|
H3QuerySourceResponse,
|
|
48
64
|
} from './h3-query-source.js';
|
|
49
65
|
|
|
50
|
-
export {h3TableSource}
|
|
66
|
+
export {h3TableSource};
|
|
51
67
|
export type {
|
|
52
68
|
H3TableSourceOptions,
|
|
53
69
|
H3TableSourceResponse,
|
|
54
70
|
} from './h3-table-source.js';
|
|
55
71
|
|
|
56
|
-
export {h3TilesetSource}
|
|
72
|
+
export {h3TilesetSource};
|
|
57
73
|
export type {
|
|
58
74
|
H3TilesetSourceOptions,
|
|
59
75
|
H3TilesetSourceResponse,
|
|
60
76
|
} from './h3-tileset-source.js';
|
|
61
77
|
|
|
62
|
-
export {rasterSource}
|
|
78
|
+
export {rasterSource};
|
|
63
79
|
export type {RasterSourceOptions} from './raster-source.js';
|
|
64
80
|
|
|
65
|
-
export {quadbinQuerySource}
|
|
81
|
+
export {quadbinQuerySource};
|
|
66
82
|
export type {
|
|
67
83
|
QuadbinQuerySourceOptions,
|
|
68
84
|
QuadbinQuerySourceResponse,
|
|
69
85
|
} from './quadbin-query-source.js';
|
|
70
86
|
|
|
71
|
-
export {quadbinTableSource}
|
|
87
|
+
export {quadbinTableSource};
|
|
72
88
|
export type {
|
|
73
89
|
QuadbinTableSourceOptions,
|
|
74
90
|
QuadbinTableSourceResponse,
|
|
75
91
|
} from './quadbin-table-source.js';
|
|
76
92
|
|
|
77
|
-
export {quadbinTilesetSource}
|
|
93
|
+
export {quadbinTilesetSource};
|
|
78
94
|
export type {
|
|
79
95
|
QuadbinTilesetSourceOptions,
|
|
80
96
|
QuadbinTilesetSourceResponse,
|
|
81
97
|
} from './quadbin-tileset-source.js';
|
|
82
98
|
|
|
83
|
-
export {vectorQuerySource}
|
|
99
|
+
export {vectorQuerySource};
|
|
84
100
|
export type {
|
|
85
101
|
VectorQuerySourceOptions,
|
|
86
102
|
VectorQuerySourceResponse,
|
|
87
103
|
} from './vector-query-source.js';
|
|
88
104
|
|
|
89
|
-
export {vectorTableSource}
|
|
105
|
+
export {vectorTableSource};
|
|
90
106
|
export type {
|
|
91
107
|
VectorTableSourceOptions,
|
|
92
108
|
VectorTableSourceResponse,
|
|
93
109
|
} from './vector-table-source.js';
|
|
94
110
|
|
|
95
|
-
export {vectorTilesetSource}
|
|
111
|
+
export {vectorTilesetSource};
|
|
96
112
|
export type {
|
|
97
113
|
VectorTilesetSourceOptions,
|
|
98
114
|
VectorTilesetSourceResponse,
|
|
99
115
|
} from './vector-tileset-source.js';
|
|
100
116
|
|
|
101
|
-
export {trajectoryQuerySource}
|
|
117
|
+
export {trajectoryQuerySource};
|
|
102
118
|
export type {
|
|
103
119
|
TrajectoryQuerySourceOptions,
|
|
104
120
|
TrajectoryQuerySourceResponse,
|
|
105
121
|
} from './trajectory-query-source.js';
|
|
106
122
|
|
|
107
|
-
export {trajectoryTableSource}
|
|
123
|
+
export {trajectoryTableSource};
|
|
108
124
|
export type {
|
|
109
125
|
TrajectoryTableSourceOptions,
|
|
110
126
|
TrajectoryTableSourceResponse,
|
|
111
127
|
} from './trajectory-table-source.js';
|
|
128
|
+
|
|
129
|
+
export const CARTO_SOURCES = {
|
|
130
|
+
boundaryQuerySource,
|
|
131
|
+
boundaryTableSource,
|
|
132
|
+
h3QuerySource,
|
|
133
|
+
h3TableSource,
|
|
134
|
+
h3TilesetSource,
|
|
135
|
+
quadbinQuerySource,
|
|
136
|
+
quadbinTableSource,
|
|
137
|
+
quadbinTilesetSource,
|
|
138
|
+
rasterSource,
|
|
139
|
+
trajectoryQuerySource,
|
|
140
|
+
trajectoryTableSource,
|
|
141
|
+
vectorQuerySource,
|
|
142
|
+
vectorTableSource,
|
|
143
|
+
vectorTilesetSource,
|
|
144
|
+
};
|