@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 CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## 0.5
6
6
 
7
+ ### 0.5.20
8
+
9
+ - fix(fetchMap): support quantile color scale with 2 ranges (#241)
10
+
7
11
  ### 0.5.19
8
12
 
9
13
  - fix(fetchMap): support point radius aggregation (#242)
@@ -9857,7 +9857,13 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
9857
9857
  return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
9858
9858
  }
9859
9859
  if (scaleType === "quantile" && attribute.quantiles) {
9860
- return "global" in attribute.quantiles ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
9860
+ const quantiles = "global" in attribute.quantiles ? attribute.quantiles.global : attribute.quantiles;
9861
+ if (scaleLength === 2 && !quantiles[2] && quantiles[4]?.length === 5) {
9862
+ return [quantiles[4][0], quantiles[4][2], quantiles[4][4]];
9863
+ }
9864
+ if (quantiles[scaleLength]) {
9865
+ return quantiles[scaleLength];
9866
+ }
9861
9867
  }
9862
9868
  let { min: min2 } = attribute;
9863
9869
  if (scaleType === "log" && min2 === 0) {