Open benyamindsmith opened 1 year ago
Maybe magick comes in handy here, the R wrapper for ImageMagick.
@GTBoon72 interesting. It may be possible to create these frames by making transparent places where the maps are supposed to be and overlaying it on the leaflet maps.
Played a bit around with magick, and this looks promising. It's not so using partly transparent frames, but a black-and-white mask.
library(magick) map <- image_read('https://user-images.githubusercontent.com/46410142/199815517-4da0d3f8-84a6-482c-83e7-c4e33d0dce7b.png')
ii <- magick::image_info(map) ii_min <- min(ii$width, ii$height)
mask <- magick::image_draw(image_blank(ii_min, ii_min)) symbols(ii_min/2, ii_min/2, circles=(ii_min/2)-3, bg='black', inches=FALSE, add=TRUE) dev.off()
combo <- magick::image_composite(map, mask, gravity='center', operator='copyopacity')
magick::image_background(combo, 'white')
Result:
Wow this looks beautiful! I wonder how I can fit it in the present way mapBliss
works.
If you look at frames.R
you'll see that the one frame mask I worked on so far is based on CSS.
I will try to work on this when I get the time.
Need to figure out the Shiny Code/CSS to do this: