Skip to content

Commit

Permalink
Prepare release v0.1.0 (#12)
Browse files Browse the repository at this point in the history
* Remove the R animation script.

* Clean up the frame generation script.

* renv snapshot.

* Add some instructions to the README.

* Add NEWS.md.
  • Loading branch information
MHenderson authored Jun 5, 2024
1 parent 1931409 commit dcb5553
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 55 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# room-squares-animation (development version)

# room-squares-animation (v0.1.0)

* Based on R4.4.0 and ImageMagick 6.9.10-23.
* R/create-frames.R to generate a folder of frames.
* convert from ImageMagick to generate a gif from frames.
8 changes: 0 additions & 8 deletions R/animation.R

This file was deleted.

25 changes: 11 additions & 14 deletions R/create-frames.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,20 @@ R <- tribble(~row, ~col, ~first, ~second,
# assuming that the partial room squares have rows indexed 1, ..., n - 1.
n <- max(R$row) + 1

# plot frame and write to disk
write_frame <- function(i) {
for(i in 1:nrow(R)) {

# filter the current partial Room square
# and add a variable giving the number of
# available pairs in every cell
X1 <- head(R, i) |>
add_Pe(n)

# plot the current partal Room square
plot_partial_room_square(X1)

# save the plot to disk
ggsave(file = file.path(here("plot"), paste0("frame", sprintf("%02d", i), ".png")), width = 4, height = 4, bg = "white", create.dir = TRUE)
head(R, i) |>
add_Pe(n) |>
plot_partial_room_square() |>
ggsave(
file = file.path(here("plot"), paste0("frame", sprintf("%02d", i), ".png")),
width = 4,
height = 4,
bg = "white",
create.dir = TRUE
)

}

for(i in 1:nrow(R)) {
write_frame(i)
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# room-squares-animation

## Instructions

First generate frames:

```
make frames
```

Then generate `gif/out.gif`:

```
make gif
```

## Output

![](gif/out.gif)
33 changes: 0 additions & 33 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@
],
"Hash": "45f0398006e83a5b10b72a90663d8d8c"
},
"Rcpp": {
"Package": "Rcpp",
"Version": "1.0.12",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"methods",
"utils"
],
"Hash": "5ea2700d21e038ace58269ecdbeb9ec0"
},
"cli": {
"Package": "cli",
"Version": "3.6.2",
Expand Down Expand Up @@ -107,16 +96,6 @@
],
"Hash": "5a295d7d963cc5035284dcdbaf334f4e"
},
"curl": {
"Package": "curl",
"Version": "5.2.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "411ca2c03b1ce5f548345d2fc2685f7a"
},
"dplyr": {
"Package": "dplyr",
"Version": "1.1.4",
Expand Down Expand Up @@ -281,18 +260,6 @@
],
"Hash": "b8552d117e1b808b09a832f589b79035"
},
"magick": {
"Package": "magick",
"Version": "2.8.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"Rcpp",
"curl",
"magrittr"
],
"Hash": "3f6bcbb8a0c1c9365b2f02d5d04ad7bc"
},
"magrittr": {
"Package": "magrittr",
"Version": "2.0.3",
Expand Down
2 changes: 2 additions & 0 deletions room-squares-animation.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Makefile

0 comments on commit dcb5553

Please sign in to comment.