Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
10d6751
created animint2pages()
Faye-yufan Jul 13, 2023
b70ae59
update to post files path
Faye-yufan Jul 21, 2023
5bffa3f
GH pages is fine with nested file structure
Faye-yufan Jul 24, 2023
1a980fd
Update NAMESPACE
Faye-yufan Jul 25, 2023
7ec1334
Update DESCRIPTION
Faye-yufan Jul 26, 2023
885a1f0
Merge branch '84-move-gallery-from-blocks-to-gh-pages' of https://git…
Faye-yufan Jul 26, 2023
b660d21
use `git2r::cred_token()` for gh authentication
Faye-yufan Jul 26, 2023
cbc942c
Error in 'git2r_branch_create': 'commit' must be an S3 class git_commit
Faye-yufan Jul 26, 2023
bbdeeb6
Create test-compiler-ghpages.R
Faye-yufan Jul 27, 2023
4232198
Merge branch '84-move-gallery-from-blocks-to-gh-pages' of https://git…
Faye-yufan Jul 28, 2023
2b20045
Check if there are any commits in the repo
Faye-yufan Aug 1, 2023
07967fe
use `gert` package and HTTPS protocal
Faye-yufan Sep 1, 2023
d2497df
remove some weird spaces
Faye-yufan Sep 1, 2023
1e71068
Test: Reorder 'Collate' in DESCRIPTION to debug remote installation i…
Faye-yufan Sep 1, 2023
b6675eb
add function documentation
Faye-yufan Sep 2, 2023
1d888e3
Add error message for missing GitHub token to include detailed setup …
Faye-yufan Sep 12, 2023
e738e8f
Add test for error message
Faye-yufan Sep 12, 2023
d71f928
Merge branch 'master' of https://github.com/tdhock/animint2 into 84-m…
Faye-yufan Sep 15, 2023
99f18cc
combine whoami and gitcreds_get()
Faye-yufan Sep 17, 2023
96dc8cf
use gitcreds_get(), cuz gh_whoami() doesn't raise error
Faye-yufan Sep 17, 2023
6ccc1df
move unit test
Faye-yufan Oct 13, 2023
661b6a7
update plot.list
Faye-yufan Oct 13, 2023
e07e137
Dynamically identify the active Git branch
Faye-yufan Oct 13, 2023
e2cc27d
Add man/animint2pages.Rd and update test case
Faye-yufan Oct 13, 2023
d01b457
Update logic of identifying the active branch
Faye-yufan Oct 13, 2023
a694218
source option saved to plot.json and displayed below viz
tdhock Oct 27, 2023
7d26efb
bugfix when git_branch returns character
tdhock Oct 27, 2023
c1a4fa9
add viz url into README.md
Faye-yufan Oct 28, 2023
15a7067
raise error if input `github_repo` contains "/" forward slash
Faye-yufan Oct 28, 2023
0fb6fc9
stop if required_opts not present
tdhock Oct 28, 2023
54355b9
version++
tdhock Oct 28, 2023
2c04fbf
fix typo
tdhock Oct 28, 2023
9395b1c
provide header engine
tdhock Oct 28, 2023
26e6713
ignore readme_website
tdhock Oct 28, 2023
a4f66e3
reformat tryCatch, 1 line string for easier translation
tdhock Nov 1, 2023
a123196
replace `git2r::commits` with `gert::git_log`
Faye-yufan Nov 1, 2023
f41c1bf
delete animint2gist, and run `roxygen2::roxygenise()`
Faye-yufan Nov 1, 2023
0f469f5
Merge branch '84-move-gallery-from-blocks-to-gh-pages' of https://git…
Faye-yufan Nov 1, 2023
24f37f8
add update_gallery fun
tdhock Nov 1, 2023
7d90528
Merge branch '84-move-gallery-from-blocks-to-gh-pages' of github.com:…
tdhock Nov 1, 2023
4bd9344
get_repo_row->get_pages_info
tdhock Nov 1, 2023
2d305ee
link gallery
tdhock Nov 1, 2023
e474342
Merge branch 'master' into 84-move-gallery-from-blocks-to-gh-pages
tdhock Nov 1, 2023
717cab6
fix pages tests
tdhock Nov 2, 2023
438763e
Merge branch '84-move-gallery-from-blocks-to-gh-pages' of github.com:…
tdhock Nov 2, 2023
4701098
line breaks in docs
tdhock Nov 2, 2023
500392e
rm commented code with empty href to fix CRAN check warning about ins…
tdhock Nov 2, 2023
274e199
rm plot arg from docs
tdhock Nov 2, 2023
439be01
rm ghpages test on CRAN
tdhock Nov 2, 2023
631ccb2
do not include vignette on CRAN to save disk space
tdhock Nov 2, 2023
8ef8577
remove aes_q NULL test which was failing on CRAN
tdhock Nov 2, 2023
ac41dfe
\itemize->\describe
tdhock Nov 2, 2023
8ff04ca
rm gist test
tdhock Nov 2, 2023
610cab3
do not include VignetteBuilder on CRAN
tdhock Nov 2, 2023
25e6596
fix skip tests
tdhock Nov 2, 2023
02027e2
set user name and email before running tests
tdhock Nov 2, 2023
4962559
test owner=animint, repo=animint/animint2pages_test_repo
Faye-yufan Nov 4, 2023
7c1186c
new setting not working, change token to the previous one
Faye-yufan Nov 4, 2023
38776ad
expect geom_text color
tdhock Nov 5, 2023
56a3583
fix geom text
tdhock Nov 5, 2023
48a4296
bugfix geom_text
tdhock Nov 5, 2023
cbdabd1
text color tests
tdhock Nov 5, 2023
f922021
specify columns in meta
tdhock Nov 5, 2023
fb65ff8
use get_fill in get_fill_off
tdhock Nov 6, 2023
a11d1d2
remove typo
tdhock Nov 12, 2023
2698902
reformat line breaks
tdhock Nov 12, 2023
c71b8ff
comment
tdhock Nov 12, 2023
1fde9d2
range_is_zero helper
tdhock Nov 12, 2023
9cfe4d4
rm sqrt y example
tdhock Nov 12, 2023
7b6066a
typo
tdhock Nov 12, 2023
e8bfa46
clarify geom_text fix
tdhock Nov 12, 2023
893788b
clarify gallery input/output
tdhock Nov 12, 2023
9cc8788
big re-organization
tdhock Nov 12, 2023
b4eed26
fix scales
tdhock Nov 12, 2023
6f91b76
bugfix geom_point stroke param
tdhock Nov 13, 2023
ff7cdaa
bugfix for geom_point with aes(color) and param fill
tdhock Nov 13, 2023
a260b8c
fix text size, angle, stroke
tdhock Nov 13, 2023
84a1d3b
fix global variables and polygon drawing
tdhock Nov 13, 2023
ed3c140
rm _stroke
tdhock Nov 13, 2023
493fc83
print diff.vars
tdhock Nov 13, 2023
f0b90c9
more prints
tdhock Nov 13, 2023
51f95ef
d is local
tdhock Nov 13, 2023
ec0641e
set defaults after geom specific code
tdhock Nov 14, 2023
325ec99
change && to || to fix point fill
tdhock Nov 14, 2023
e0e6bbd
tile color/stroke transparent by default
tdhock Nov 14, 2023
5fb272f
text fill comes from colour
tdhock Nov 14, 2023
06492f2
use getHTML
tdhock Nov 14, 2023
f479795
move expect_warning to next test
tdhock Nov 14, 2023
151e25e
fix off tests
tdhock Nov 15, 2023
1d9f795
fix default alpha_off
tdhock Nov 15, 2023
4180b88
fix tests
tdhock Nov 15, 2023
c5efbaa
fix tests
tdhock Nov 15, 2023
42b0271
version++
tdhock Nov 15, 2023
47c9f1b
get_alpha_off same as alpha when aes is set
tdhock Nov 15, 2023
fb8f297
commit repos.txt
tdhock Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
readme_website.md
.github
^.*\.Rproj$
^\.Rproj\.user$
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ jobs:
fail-fast: false
matrix:
test-suite: [ renderer1,renderer2,renderer3,renderer4,renderer5,compiler,CRAN]

# services:
# selenium:
# image: selenium/standalone-firefox-debug:2.53.0
# ports:
# - 5900:5900
# - 4444:4444

name: Test Suite ${{ matrix.test-suite }}
env:
Expand All @@ -41,6 +34,12 @@ jobs:

- name: install package
run: R CMD INSTALL .

- name: git config user.name
run: git config --global user.name "GitHub Actions"

- name: git config user.email
run: git config --global user.email toby.hocking@r-project.org

- name: run tests
run: if [ "$TEST_SUITE" == "CRAN" ];then bash build.sh;else Rscript -e "source('tests/testthat.R', chdir = TRUE)";fi
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: animint2
Title: Animated Interactive Grammar of Graphics
Version: 2023.6.11
Version: 2023.11.15
URL: https://animint.github.io/animint2/
BugReports: https://github.com/animint/animint2/issues
Authors@R: c(
Expand Down Expand Up @@ -76,6 +76,7 @@ Imports:
methods
Suggests:
servr,
gert, gitcreds, gh,
sp,
gistr (>= 0.2),
shiny,
Expand Down Expand Up @@ -269,12 +270,13 @@ Collate:
'z_animintHelpers.R'
'z_facets.R'
'z_geoms.R'
'z_gist.R'
'z_helperFunctions.R'
'z_knitr.R'
'z_pages.R'
'z_print.R'
'z_scales.R'
'z_theme_animint.R'
'z_transformShape.R'
RoxygenNote: 7.2.3
Config/Needs/website: tidyverse/tidytemplate
VignetteBuilder: knitr
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export(aes_string)
export(alpha)
export(animint)
export(animint2dir)
export(animint2gist)
export(animint2pages)
export(animintOutput)
export(annotate)
export(annotation_custom)
Expand Down Expand Up @@ -489,6 +489,7 @@ export(theme_void)
export(toRGB)
export(transform_position)
export(unit)
export(update_gallery)
export(update_geom_defaults)
export(update_labels)
export(update_stat_defaults)
Expand Down
21 changes: 21 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# Changes in 2023.11.15

- New function `animint2pages(viz,"new_github_repo")` for
publishing/sharing animints, replacement for animint2gist, which
stopped working recently.
- New option `animint(source="http://path.to/source.R")` which should
be the URL of data viz source code, used to display a link below the
rendered viz.
- New function `update_gallery("path/to/gallery_repo")` for updating
galleries such as https://animint.github.io/gallery/
- Bugfix: geom_text renders color as svg fill style (was rendering as
stroke style, a regression introduced by the initial implementation
of `fill_off`).
- re-organization of animint.js in order to reduce duplication /
emphasize similarities and differences between geoms.
- geom rect and tile now default to color="black" instead of
transparent, for consistency with other geoms (and for the case of
using clickSelects, which defaults to black color for selected, and
transparent for not). To get the old behavior, specify
color="transparent" (for non-clickSelects).

# Changes in 2023.10.6

- User-configurable selection style - fill_off.
Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
#' All built-in \code{\link{colors}()} translated into Luv colour space.
#'
#' @format A data frame with 657 observations and 4 variables:
#' \itemize{
#' \describe{
#' \item{L,u,v}{Position in Luv colour space}
#' \item{col}{Colour name}
#' }
Expand All @@ -176,7 +176,7 @@
#' real estate center, \url{https://www.recenter.tamu.edu/}.
#'
#' @format A data frame with 8602 observations and 9 variables:
#' \itemize{
#' \describe{
#' \item{city}{Name of MLS area}
#' \item{year,month,date}{Date}
#' \item{sales}{Number of sales}
Expand Down
1 change: 0 additions & 1 deletion R/geom-.r
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ Geom <- gganimintproto("Geom",
processed_values <- l$geom$pre_process(g, g.data, ranges)
g <- processed_values$g
g.data <- processed_values$g.data

## Check g.data for color/fill - convert to hexadecimal so JS can parse correctly.
for(color.var in c("colour", "color", "fill", "colour_off", "color_off", "fill_off")){
if(color.var %in% names(g.data)){
Expand Down
4 changes: 0 additions & 4 deletions R/geom-histogram.r
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
#' # Use origin = 0, to make sure we don't take sqrt of negative values
#' m + geom_histogram(origin = 0) + coord_trans(x = "sqrt")
#'
#' # You can also transform the y axis. Remember that the base of the bars
#' # has value 0, so log transformations are not appropriate
#' m <- ggplot(movies, aes(x = rating))
#' m + geom_histogram(binwidth = 0.5) + scale_y_sqrt()
#' }
#' rm(movies)
geom_histogram <- function(mapping = NULL, data = NULL,
Expand Down
5 changes: 1 addition & 4 deletions R/geom-tile.r
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GeomTile <- gganimintproto("GeomTile", GeomRect,
)
},

default_aes = aes(fill = "grey20", colour = NA, size = 0.1, linetype = 1,
default_aes = aes(fill = "grey20", colour = "black", size = 0.1, linetype = 1,
alpha = NA),

required_aes = c("x", "y"),
Expand All @@ -104,9 +104,6 @@ GeomTile <- gganimintproto("GeomTile", GeomRect,

pre_process = function(g, g.data, ...) {
g$geom <- "rect"
if(is.null(g$params$colour)){
g$params$colour <- "transparent"
}
return(list(g = g, g.data = g.data))
}
)
1 change: 0 additions & 1 deletion R/plot-build.r
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ layer_grob <- function(plot, i = 1L) {
#' a ggplot2 plot.
#' @return a \code{\link{gtable}} object
#' @keywords internal
#' @param plot plot object
#' @param data plot data generated by \code{\link{ggplot_build}}
#' @export
ggplot_gtable <- function(data) {
Expand Down
10 changes: 6 additions & 4 deletions R/scale-.r
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ Scale <- gganimintproto("Scale", NULL,
}
},

range_is_zero = function(self, limits) {
isTRUE(scales::zero_range(as.numeric(limits)))
},

# The physical size of the scale.
# This always returns a numeric vector of length 2, giving the physical
# dimensions of a scale.
Expand Down Expand Up @@ -206,15 +210,13 @@ ScaleContinuous <- gganimintproto("ScaleContinuous", Scale,

get_breaks = function(self, limits = self$get_limits()) {
if (self$is_empty()) return(numeric())

# Limits in transformed space need to be converted back to data space
limits <- self$trans$inverse(limits)

if (is.null(self$breaks)) {
return(NULL)
} else if (identical(self$breaks, NA)) {
stop("Invalid breaks specification. Use NULL, not NA")
} else if (zero_range(as.numeric(limits))) {
} else if (self$range_is_zero(limits)) {
breaks <- limits[1]
} else if (is.waive(self$breaks)) {
breaks <- self$trans$breaks(limits)
Expand All @@ -240,7 +242,7 @@ ScaleContinuous <- gganimintproto("ScaleContinuous", Scale,
},

get_breaks_minor = function(self, n = 2, b = self$break_positions(), limits = self$get_limits()) {
if (zero_range(as.numeric(limits))) {
if (self$range_is_zero(limits)) {
return()
}

Expand Down
8 changes: 6 additions & 2 deletions R/z_animint.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ animint2dir <- function(plot.list, out.dir = NULL,
if(!is.null(plot.list$out.dir)){
plot.list$out.dir <- NULL
}
if(is.character(plot.list[["source"]])){
meta$source <- plot.list[["source"]]
plot.list$source <- NULL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows the user to specify source as one of the plot options, it should be a URL where we can find the source code for this data viz.

}

## Extract essential info from ggplots, reality checks.
for(list.name in names(plot.list)){
Expand Down Expand Up @@ -631,8 +635,8 @@ animint2dir <- function(plot.list, out.dir = NULL,
file.copy(style.file, file.path(out.dir, "styles.css"), overwrite=TRUE)
}
file.copy(to.copy, out.dir, overwrite=TRUE, recursive=TRUE)
export.names <-
c("geoms", "time", "duration", "selectors", "plots", "title")
export.names <- c(
"geoms", "time", "duration", "selectors", "plots", "title", "source")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this saves the source option in the plot.json file.

export.data <- list()
for(export.name in export.names){
if(export.name %in% ls(meta)){
Expand Down
80 changes: 0 additions & 80 deletions R/z_gist.R

This file was deleted.

Loading