CartoDB / turbo-carto

CartoCSS preprocessor
BSD 3-Clause "New" or "Revised" License
28 stars 7 forks source link

Zero should behave as null or nodata value #68

Closed ramiroaznar closed 7 years ago

ramiroaznar commented 7 years ago

I would like to open a discussion about the behavior of 0 values within ramps functions. In my humble opinion, in the majority of use cases, they should not be included in the first bucket. For instance, when making a bubble map features with 0 values should have marker-width: 0.

The only use case that makes sense to be included in any bucket is when you have negative and positive values.

cc @makella @AbelVM @rochoa

PD: related tweet.

AbelVM commented 7 years ago

I strongly disagree.

Zero is a value like any other.

The "weight" of it depends on the parameter you are measuring and the meaning of it within the context

rochoa commented 7 years ago

If you know the domain of your data, you can always overwrite some properties/filters.

#layer {
  marker-width: ramp([col], range(2,8));
  [col = 0] {
    marker-width: 0;
  }
}

What do you think about that approach?

ramiroaznar commented 7 years ago

That's what I did when I encountered this use case. :-)

rochoa commented 7 years ago

Thus, I'm closing this one.