r-spatial / leafgl

R package for fast web gl rendering for leaflet
Other
263 stars 31 forks source link

Can the opacity depend on a variable? #2

Open SimonCoulombe opened 6 years ago

SimonCoulombe commented 6 years ago

For example, in addPolygon you could specify fillOpacity to depend on the variable most_common_gender_percentage, like this:

addPolygons( fillColor = ~ mypal_bin(mydata$most_common_gender), # color shows most common gender fillOpacity = ~ most_common_gender_percentage, ## opacity proportionnal to the common gender percentage)

tim-salabim commented 6 years ago

The javascript dependency at Leaflet.glify does not support a vector of opacities at the moment. I don't think it would be overly complicated to implement this, though I am no expert in JS.

I suggest you open an issue in the original repo and link back to this one to document where the request originated.

Once we can pass a vector of opacities to the JS source, I am happy to implement it here.

SimonCoulombe commented 6 years ago

will do - thanks :)