Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharlagelfand/ggkeyboard
Make a keyboard using ggplot2.
https://github.com/sharlagelfand/ggkeyboard
Last synced: 2 days ago
JSON representation
Make a keyboard using ggplot2.
- Host: GitHub
- URL: https://github.com/sharlagelfand/ggkeyboard
- Owner: sharlagelfand
- License: other
- Created: 2020-07-29T12:42:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-09T17:11:46.000Z (11 months ago)
- Last Synced: 2024-08-03T23:23:32.019Z (3 months ago)
- Language: R
- Size: 22.9 MB
- Stars: 92
- Watchers: 5
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
fig.width = 10,
fig.height = 4.5,
dpi = 300
)
```# ggkeyboard
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
ggkeyboard lets you plot a keyboard and change the colours on it. This package is very experimental, so expect breaking changes as I work through making all the customization options as friendly as possible.
You can install ggkeyboard from github:
``` r
# install.packages("devtools")
devtools::install_github("sharlagelfand/ggkeyboard", ref = "main")
```# Usage
Plot a keyboard using `ggkeyboard()`. The default is very cute:
```{r pastel}
library(ggkeyboard)ggkeyboard()
```## Colour palettes
You can change the colours, font, sizes, etc. There are a few built in colour palettes, available via `keyboard_palette()`:
```{r palette}
library(scales)show_col(keyboard_palette("serika"))
```This keyboard is inspired by the [Drop + Zambumon MT3 Serika Custom Keycap Set](https://drop.com/buy/drop-zambumon-mt3-serika-custom-keycap-set):
```{r serika}
ggkeyboard(palette = keyboard_palette("serika"))
```This one is inspired by the [Melgeek MG Wahtsy ABS Doubleshot Keycap Set](https://drop.com/buy/melgeek-mg-wahtsy-abs-doubleshot-keycap-set):
```{r wahtsy}
ggkeyboard(palette = keyboard_palette("wahtsy"))
```and this one by the [Domikey ABS Doubleshot SA Cyberpunk Pumper Keycap Set](https://drop.com/buy/domikey-abs-doubleshot-sa-cyberpunk-pumper-keycap-set):
```{r cyberpunk}
ggkeyboard(palette = keyboard_palette("cyberpunk"))
```## Layouts
`ggkeyboard()` defaults to using a tenkeyless keyboard, available in `tkl`:
```{r tkl}
head(tkl)
```There is also a full keyboard layout available via `full`. This palette is based off the [Varmilo VA108 Fullsize Keyboard](https://drop.com/buy/varmilo-108-keyboard)
```{r full}
ggkeyboard(full, palette = keyboard_palette("varmilo"), font_size = 2.75)
```a 60% layout available via `sixty_percent` (colour palette based off the [Drop + T0mb3ry SA Yuri Custom Keycap Set](https://drop.com/buy/drop-t0mb3ry-sa-yuri-custom-keycap-set)):
```{r sixty}
ggkeyboard(sixty_percent, palette = keyboard_palette("t0mb3ry"), adjust_text_colour = FALSE)
```and a mac layout, based off the Apple magic keyboard:
```{r mac}
ggkeyboard(mac, palette = keyboard_palette("magic"))
```You can use an ISO layout by changing `layout` to "iso", for any of the given keyboards:
```{r iso}
ggkeyboard(tkl, layout = "iso")
```## Highlighting
You can use `highlight_keys()` to emphasize any keys - for example, to highlight what keys make up the shortcut for the pipe (%>%):
```{r highlight}
ggkeyboard(tkl) %>%
highlight_keys(c("Alt Left", "Shift Left", "M"))
```