leaflet.extras icon indicating copy to clipboard operation
leaflet.extras copied to clipboard

Appending values to colors.

Open im4yush opened this issue 6 years ago • 2 comments

I'm totally new to Leaflet Heatmap. All I want to know is, how the mapping of values i.e. datapoints are appended to colors in gradients? Can I set any kind of range to those datapoints? Like, datapoints having value 5 should fall in the range of 0 - 10 and so on for others to.

im4yush avatar Sep 20 '17 09:09 im4yush

I am afraid you will have to read up the Leaflet.heat code to understand what exactly goes under the hood. I am fairly busy with work stuff otherwise I would've done it myself.

bhaskarvk avatar Sep 20 '17 16:09 bhaskarvk

@im4yush if you want to map a continuous value variable to a "bucketed" range, and then use colors on the grouped/bucketed/binned column, you first need to transform the continuous numeric column, then map the transformed column to your color aesthetic. Take a peek at this: https://stackoverflow.com/questions/11963508/generate-bins-from-a-data-frame. And then this: https://rstudio.github.io/leaflet/colors.html

ngfrey avatar Sep 20 '17 19:09 ngfrey

I guess this is solved..

trafficonese avatar Mar 11 '24 09:03 trafficonese