CartoDB / carto-vl

CARTO VL: a Javascript library to create vector-based visualizations
BSD 3-Clause "New" or "Revised" License
129 stars 26 forks source link

Fix globalQuantiles expression when getting legend data #1370

Closed Jesus89 closed 5 years ago

Jesus89 commented 5 years ago

From https://github.com/CartoDB/cartoframes/issues/724

Context ===

globalQuantiles expression when used in a ramp is not returning values properly. Here there are the cases in the internal editor. Open the console and run layer.viz.color.getLegendData() to debug:

Legend data:

[-Infinity, Infinity]
[-Infinity, 0.001]
[0.001, 2]
[2, 4]
[4, Infinity]

Legend data:

[-Infinity, Infinity]
[-Infinity, Infinity]
[-Infinity, Infinity]
[-Infinity, 1]
[1, Infinity]
Jesus89 commented 5 years ago

I would be nice that instead of Infinity or -Infinity, it returned the global min/max to have more meaningful legends.

elenatorro commented 5 years ago

I like this idea, I am thinking about how to implement it for the rest of classifiers.