leafgl icon indicating copy to clipboard operation
leafgl copied to clipboard

Can the opacity depend on a variable?

Open SimonCoulombe opened this issue 7 years ago • 2 comments

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)

SimonCoulombe avatar Oct 26 '18 17:10 SimonCoulombe

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.

tim-salabim avatar Oct 27 '18 08:10 tim-salabim

will do - thanks :)

SimonCoulombe avatar Oct 27 '18 10:10 SimonCoulombe