diff --git a/.Rbuildignore b/.Rbuildignore index 9a55673..5989977 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,6 +13,7 @@ ^data-raw$ ^codecov.yml$ ^doc$ +^revdep$ ^tmp$ ^Meta$ ^\.git$ diff --git a/.gitignore b/.gitignore index 1313f1c..9f2b1dd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ codecov.yml /doc/ /Meta/ /pkgdown/ +/revdep/ /tmp/ data-raw/*.png vignettes/*.R diff --git a/DESCRIPTION b/DESCRIPTION index c77b2b7..7b3d6e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: gridpattern Type: Package Title: 'grid' Pattern Grobs -Version: 1.4.0-3 +Version: 1.4.2 Authors@R: c( person("Trevor L.", "Davis", role=c("aut", "cre"), email="trevor.l.davis@gmail.com", comment = c(ORCID = "0000-0001-6341-4639")), diff --git a/NEWS.md b/NEWS.md index dd7eb5c..0a958c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -gridpattern v1.4.0 (development) -================================ +gridpattern v1.4.2 +================== Breaking Changes ---------------- @@ -28,14 +28,6 @@ New Features Bug fixes and minor improvements -------------------------------- -* Fixes a bug where the `"sine"` (aliases `"wavy"`, `"undy"`) and `"triangle"` wave - types had an effective wavelength of `(n-1)/n` times the requested wavelength, - where `n` is the number of wavelength-spaced grid positions spanning the viewport. - The error was most visible when only a few periods were displayed - (e.g. `spacing ≈ wavelength`), where the period was up to 20% too short. - As a side effect, these wave types now have their peaks correctly phase-aligned - with the other wave types (peak at one quarter of the wavelength from the left edge). - * Fixes a bug where geometry-based patterns (e.g. "stripe", "crosshatch", "wave") could silently disappear in small viewports when `pattern_key_scale_factor` was a relatively large value (#95). @@ -52,6 +44,9 @@ Bug fixes and minor improvements + The "placeholderbw" name now provides a pure black-and-white image (i.e. no grey). +* Fixes a bug where the `"wavy"` (aliases `"sine"`, `"undy"`) and `"indented"` (alias `"triangle"`) wave types had an effective wavelength of `(n-1)/n` times the requested wavelength, where `n` is the number of wavelength-spaced grid positions spanning the viewport. + + gridpattern v1.3.1 ================== diff --git a/R/utils-color.R b/R/utils-color.R index cd57486..98882f8 100644 --- a/R/utils-color.R +++ b/R/utils-color.R @@ -38,11 +38,12 @@ quadratic_mean <- function(x) sqrt(mean(x^2)) #' @param mixingMethod Mixing method passed to [aqp::mixMunsell()]. #' @return A single R color string in hex notation. #' @examples -#' if (requireNamespace("aqp", quietly = TRUE)) { -#' mix_col("red", "blue") +#' should_run_ex <- requireNamespace("aqp", quietly = TRUE) && +#' (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")) +#' if (should_run_ex) { #' mix_col(c("red", "blue")) #' } -#' if (requireNamespace("aqp", quietly = TRUE)) { +#' if (should_run_ex) { #' mix_col("red", "yellow", "blue", w = c(2, 1, 1)) #' } #' @seealso [mean_col()] for a simpler quadratic-mean RGB approach (no extra packages required). diff --git a/cran-comments.md b/cran-comments.md index fc049e1..34d3b05 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,8 @@ +* Skips running a new `mix_col` example on CRAN to avoid triggering a "Examples with CPU time > 2.5 times elapsed time" NOTE + ## Test environments -* local (linux, R 4.4.2) +* local (linux, R 4.6.0) * win-builder (windows, R devel) * github actions (linux, R oldrel) * github actions (linux, R release) @@ -8,4 +10,13 @@ ## R CMD check --as-cran results -OK +1 NOTE + +Several Wikipedia URLs returning a 429 "Too Many Requests" response---these are all valid URLs. + +## revdepcheck results + +We checked 4 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages diff --git a/man/mix_col.Rd b/man/mix_col.Rd index 7a6ab1b..4edf510 100644 --- a/man/mix_col.Rd +++ b/man/mix_col.Rd @@ -25,11 +25,12 @@ input colors to Munsell notation via \code{\link[aqp:col2Munsell]{aqp::col2Munse via \code{\link[aqp:parseMunsell]{aqp::parseMunsell()}}. } \examples{ -if (requireNamespace("aqp", quietly = TRUE)) { - mix_col("red", "blue") +should_run_ex <- requireNamespace("aqp", quietly = TRUE) && + (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")) +if (should_run_ex) { mix_col(c("red", "blue")) } -if (requireNamespace("aqp", quietly = TRUE)) { +if (should_run_ex) { mix_col("red", "yellow", "blue", w = c(2, 1, 1)) } } diff --git a/tests/testthat/test_utils.R b/tests/testthat/test_utils.R index d487ef4..ec00922 100644 --- a/tests/testthat/test_utils.R +++ b/tests/testthat/test_utils.R @@ -82,6 +82,7 @@ test_that("`assert_patterns_unique()` works as expected", { }) test_that("`mix_col()` works as expected", { + skip_on_cran() skip_if_not_installed("aqp") expect_equal(mix_col(c("red", "blue")), "#C2008FFF") expect_equal(mix_col(c("yellow", "green")), "#ACFF00FF") diff --git a/vignettes/hatching.Rmd b/vignettes/hatching.Rmd index c3a6066..2b3e21c 100644 --- a/vignettes/hatching.Rmd +++ b/vignettes/hatching.Rmd @@ -13,6 +13,8 @@ knitr::opts_chunk$set( comment = "#>" ) can_render <- capabilities("png") || guess_has_R4.1_features("masks") +can_run_aqp <- requireNamespace("aqp", quietly = TRUE) && + (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true") || identical(Sys.getenv("NOT_CRAN"), "true")) ``` The `gridpattern` package supports heraldic color hatching via `grid.pattern_hatch()`. @@ -53,7 +55,7 @@ The default `"combinatorial"` subtype starts from the set of five [Munsell prima 2. **yellow + color** → dotdash lines 3. **color + color** → crossing solid lines -```{r combinatorial-table, fig.alt = "Color table showing the Combinatorial Petra Sancta tinctures arranged by achromatic, primaries, secondaries, and notable combinations", fig.width = 7, fig.height = 8.5, eval = can_render && requireNamespace("aqp", quietly = TRUE), echo = FALSE} +```{r combinatorial-table, fig.alt = "Color table showing the Combinatorial Petra Sancta tinctures arranged by achromatic, primaries, secondaries, and notable combinations", fig.width = 7, fig.height = 8.5, eval = can_render && can_run_aqp, echo = FALSE} # Munsell primary colors p_col <- c( argent = "#FFFFFF",