Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

GTBoon72
Copy link

With this update, the sample call in the frame.R file produces the following output:
image

@benyamindsmith
Copy link
Owner

@GTBoon72

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')
Copy link
Owner

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"))
Copy link
Owner

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

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants