Where can I find a reference for the functions available for CartoCSS styling on carto.com? The documentation only gives a few examples and nowhere can I find the set of mathematical operations that can be performed.

#layer {
  marker-width: ramp([my_field], range(5, 25), equal(5));
  marker-fill: #AAA
  marker-fill-opacity: 0.8;
  marker-allow-overlap: true;

Can I apply a function (such as log or sqrt) to my_field before making the ramp? Where is the documentation for ramp?


ramp is a function of TurboCARTO, a CartoCSS preprocessor developed by CARTO. You can find also short tutorials in CARTO guides.

Unfortunately, right now you cannot apply other functions like the ones you mentioned as arguments in ramp functions. The issue has been reported already by Mamata Akella (you can check it in the repository) and there is a possibility that they could be implemented in the future. In the meanwhile, you would need to create new fields with those functions using SQL and then apply the style.

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.