Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -13,6 +13,7 @@
^data-raw$
^codecov.yml$
^doc$
^revdep$
^tmp$
^Meta$
^\.git$
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ codecov.yml
/doc/
/Meta/
/pkgdown/
/revdep/
/tmp/
data-raw/*.png
vignettes/*.R
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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")),
Expand Down
15 changes: 5 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gridpattern v1.4.0 (development)
================================
gridpattern v1.4.2
==================

Breaking Changes
----------------
Expand Down Expand Up @@ -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).
Expand All @@ -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
==================

Expand Down
7 changes: 4 additions & 3 deletions R/utils-color.R
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
15 changes: 13 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
* 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)
* github actions (linux, R devel)

## 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
7 changes: 4 additions & 3 deletions man/mix_col.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/test_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion vignettes/hatching.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
Expand Down Expand Up @@ -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",
Expand Down
Loading