Skip to content

Commit

Permalink
Add four more spinners from Henrik
Browse files Browse the repository at this point in the history
Closes #469.
  • Loading branch information
gaborcsardi committed Aug 23, 2022
1 parent 4dda2f9 commit 71146c2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
8 changes: 5 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# cli (development version)

* 20 new spinners from the awesome
[cli-spinners](https://github.com/sindresorhus/cli-spinners) package.
Run this to demo them, some of them need emoji support:
[cli-spinners](https://github.com/sindresorhus/cli-spinners) package,
and from @HenrikBengtsson in #469.
Run this to demo to see them, some need UTF-8 and emoji support:

```r
new <- c("dots13", "dots8Bit", "sand", "material", "weather", "christmas",
"grenade", "point", "layer", "betaWave", "fingerDance", "fistBump",
"soccerHeader", "mindblown", "speaker", "orangePulse", "bluePulse",
"orangeBluePulse", "timeTravel", "aesthetic")
"orangeBluePulse", "timeTravel", "aesthetic", "growVeriticalDotsLR",
"growVeriticalDotsRL", "growVeriticalDotsLL", "growVeriticalDotsRR")
demo_spinners(new)
```

Expand Down
13 changes: 1 addition & 12 deletions R/spinner.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@

## This is how the RDS file is created:

'
json <- "https://raw.githubusercontent.com/sindresorhus/cli-spinners/45cef9dff64ac5e36b46a194c68bccba448899ac/spinners.json"
parsed <- jsonlite::fromJSON(json, simplifyVector = TRUE)
pasis <- lapply(parsed, function(x) { x$frames <- I(x$frames); x })
pdt <- as.data.frame(do.call(rbind, pasis))
pdt$name <- rownames(pdt)
rownames(pdt) <- NULL
spinners <- pdt[, c("name", "interval", "frames")]
usethis::use_data(spinners, internal = TRUE)
'
## See tools/spinners.R for how the RDS file is created

#' Character vector to put a spinner on the screen
#'
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
16 changes: 16 additions & 0 deletions tools/spinners.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

json <- "https://raw.githubusercontent.com/sindresorhus/cli-spinners/45cef9dff64ac5e36b46a194c68bccba448899ac/spinners.json"
parsed <- jsonlite::fromJSON(json, simplifyVector = TRUE)
pasis <- lapply(parsed, function(x) { x$frames <- I(x$frames); x })
pdt <- as.data.frame(do.call(rbind, pasis))
pdt$name <- rownames(pdt)
rownames(pdt) <- NULL
spinners <- pdt[, c("name", "interval", "frames")]
usethis::use_data(spinners, internal = TRUE)
spinners <- rbind(
spinners,
list(name = "growVeriticalDotsLR", interval = 80, frames = strsplit("⠀⡀⣀⣄⣤⣦⣶⣷⣿⣾⣶⣴⣤⣠⣀⢀", "")),
list(name = "growVeriticalDotsRL", interval = 80, frames = strsplit("⠀⢀⣀⣠⣤⣴⣶⣾⣿⣷⣶⣦⣤⣄⣀⡀", "")),
list(name = "growVeriticalDotsLL", interval = 80, frames = strsplit("⠀⡀⣀⣄⣤⣦⣶⣷⣿⣷⣶⣦⣤⣄⣀⡀", "")),
list(name = "growVeriticalDotsRR", interval = 80, frames = strsplit("⠀⡀⣀⣠⣤⣴⣶⣾⣿⣾⣶⣴⣤⣠⣀⢀", ""))
)

0 comments on commit 71146c2

Please sign in to comment.