-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add circular mask option #12
base: main
Are you sure you want to change the base?
Conversation
Wow this is amazing! Going to add a few feedbacks to see if you can tweak them and once that's taken care of I will merge! This is an incredible breakthrough! |
R/frames.R
Outdated
img_info_mymap <- image_info(mymap) | ||
|
||
# load mask and resize | ||
mask <- image_read('masks/circular_mask.png') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since its possible to switch out the masks, it would be good to just have an argument mask
in the function and have a few named arguments e.g. c("circle","square", "house") and do some if else
logic to parse through it.
It might also be nice to make a separate function that would allow the user to provide a custom mask as well.
R/frames.R
Outdated
myDir = tempdir() | ||
|
||
# save map as png file | ||
mapshot(map,file = paste0(myDir,"map.png")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm curious about here is that if we're able to have the mask without having to freeze the map with mapshot.
The save_map_svg
function gives us a frozen image of the map.
If its possible to have the map freely move while being covered by the mask that would be ideal.
This will be useful further down the line when implementing this code in a shiny app.
Let me know what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never realised the map was interactive in the original setup. Good idea though!
I'll have a look if this package might help us out: https://appsilon.github.io/shiny.fluent/reference/Overlay.html
With this update, the sample call in the frame.R file produces the following output: