@carto/api-client 0.5.24 → 0.5.25-alpha.ordinal-palette-fix.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.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## 0.5
5
+ - fix(fetchMap): ordinal color scale overflow categories render as "Others" instead of cycling palette (#269)
6
6
 
7
7
  ### 0.5.24
8
8
 
@@ -9860,7 +9860,7 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
9860
9860
  if (!attribute.categories) {
9861
9861
  return [0, 1];
9862
9862
  }
9863
- return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
9863
+ return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null).slice(0, scaleLength);
9864
9864
  }
9865
9865
  if (scaleType === "quantile" && attribute.quantiles) {
9866
9866
  const quantiles = "global" in attribute.quantiles ? attribute.quantiles.global : attribute.quantiles;