1

Using CARTO VL (which is awesome by the way), I have made the following groundwater harvest potential map that is styled using 10 quantiles.

enter image description here

Although the "temps" palette works well, is it possible to reverse the colors? I read a thread on GitHub that mentioned using "inverse" like this:

color: ramp(globalQuantiles($sa_m3_km2, 10), inverse(temps))

But this have never worked for me. Is inverting a quantile palette possible?

4

Yes, it is possible by using the reverse expression. Using the code from your example, it would be:

color: ramp(globalQuantiles($sa_m3_km2, 10), reverse(temps))

You can find more about this expression in our documentation: https://carto.com/developers/carto-vl/reference/#cartoexpressionsreverse

And an example from the reference using the JavaScript API:

const s = carto.expressions;
const viz = new carto.Viz({
  color: s.ramp(s.prop('type'), s.reverse(s.palettes.PRISM));
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.