Created
July 29, 2020 15:07
-
-
Save gadenbuie/192ed08d2a5909a92119758ce607b9a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# devtools::install_github("sharlagelfand/ggkeyboard", ref = "main") | |
library(ggkeyboard) | |
library(dplyr) | |
library(ggplot2) | |
# mac keys | |
keys <- tkl | |
keys$r1$key[1:7] <- c("Fn", "Ctrl", "\u2325", "\u2318", "Spacebar", "\u2318", "\u2325") | |
keys$r1$width[1:7] <- c(rep(1.05, 4), 8.25, rep(1.25, 2)) | |
keys$r1 <- keys$r1[-8, ] | |
g <- ggkeyboard(keys, font_family = "Arial Unicode MS") | |
g + | |
geom_rect( | |
data = g$layers[[2]]$data %>% | |
filter(key == "\u2318") %>% | |
slice(1), | |
aes( | |
xmin = x_start - 0.1, | |
xmax = x_end + 0.1, | |
ymin = y_start - 0.1, | |
ymax = y_end + 0.1 | |
), | |
color = "yellow", | |
fill = NA, | |
size = 2 | |
) + | |
geom_rect( | |
data = g$layers[[4]]$data %>% | |
filter(key %in% c("Shift", "M")) %>% | |
slice(1:2), | |
aes( | |
xmin = x_start - 0.1, | |
xmax = x_end + 0.1, | |
ymin = y_start - 0.1, | |
ymax = y_end + 0.1 | |
), | |
color = "yellow", | |
fill = NA, | |
size = 2 | |
) + | |
ggtitle("Ce n'est pas un clavier") + | |
theme( | |
plot.title = element_text( | |
family = "PilGi Regular", | |
size = 22, | |
hjust = 0.5, | |
color = "#f9948d" | |
) | |
) |
Author
gadenbuie
commented
Jul 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment