@carto/api-client 0.5.19 → 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 +4 -0
- package/build/api-client.cjs +7 -1
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.js +7 -1
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/fetch-map/layer-map.ts +13 -3
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;
|