From aee3e1e0f77d4231debea121a9f3d798132ccc89 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Sat, 26 Oct 2024 12:44:35 +0200 Subject: [PATCH 1/3] Add GitHub links to DESCRIPTION --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index df13515..e806acb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,3 +37,4 @@ Suggests: testthat (>= 3.0.0), vdiffr, withr +BugReports: https://github.com/teunbrand/legendry/issues From 0aa31b37ae70df14e7c83adfaaa7e2101e8b02e5 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Sat, 26 Oct 2024 12:49:30 +0200 Subject: [PATCH 2/3] do upkeep bullets --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 7 +- .github/workflows/pkgdown.yaml | 8 +- CODE_OF_CONDUCT.md | 126 +++++++++++++++++++++++++++++ DESCRIPTION | 24 +++--- README.Rmd | 4 + README.md | 7 ++ 7 files changed, 159 insertions(+), 18 deletions(-) create mode 100644 CODE_OF_CONDUCT.md diff --git a/.Rbuildignore b/.Rbuildignore index 6073cc4..342142b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^pkgdown$ ^vignettes/articles$ ^codecov\.yml$ +^CODE_OF_CONDUCT\.md$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a3ac618..d46a617 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -6,7 +6,9 @@ on: pull_request: branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -29,7 +31,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -47,3 +49,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ed7650c..4bbce75 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -9,7 +9,9 @@ on: types: [published] workflow_dispatch: -name: pkgdown +name: pkgdown.yaml + +permissions: read-all jobs: pkgdown: @@ -22,7 +24,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -41,7 +43,7 @@ jobs: - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.5.0 with: clean: false branch: gh-pages diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..05d6d4d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,126 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at tahvdbrand@gmail.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion]. + +For answers to common questions about this code of conduct, see the FAQ at +. Translations are available at . + +[homepage]: https://www.contributor-covenant.org diff --git a/DESCRIPTION b/DESCRIPTION index e806acb..26752aa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,21 +2,14 @@ Package: legendry Title: Extended guide options for 'ggplot2' Version: 0.0.0.9001 Authors@R: - person(given = "Teun", - family = "van den Brand", - role = c("aut", "cre"), - email = "tahvdbrand@gmail.com", + person("Teun", "van den Brand", , "tahvdbrand@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9335-7468")) -Description: A 'ggplot2' extension that focusses on expanding the plotter's - arsenal of guides, such as axes, legends and colour bars. +Description: A 'ggplot2' extension that focusses on expanding the + plotter's arsenal of guides, such as axes, legends and colour bars. License: MIT + file LICENSE -Encoding: UTF-8 -Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 -Config/testthat/edition: 3 -VignetteBuilder: knitr URL: https://teunbrand.github.io/legendry/, https://github.com/teunbrand/legendry +BugReports: https://github.com/teunbrand/legendry/issues Depends: ggplot2 (>= 3.5.0), R (>= 4.1.0) @@ -31,10 +24,15 @@ Imports: Suggests: knitr, ragg, - svglite, rmarkdown, + svglite, systemfonts, testthat (>= 3.0.0), vdiffr, withr -BugReports: https://github.com/teunbrand/legendry/issues +VignetteBuilder: + knitr +Config/testthat/edition: 3 +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 diff --git a/README.Rmd b/README.Rmd index 4df330f..3922055 100644 --- a/README.Rmd +++ b/README.Rmd @@ -109,3 +109,7 @@ base + ) ``` +## Code of Conduct + +Please note that the legendry project is released with a [Contributor Code of Conduct](https://teunbrand.github.io/legendry/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. + diff --git a/README.md b/README.md index 367e727..bae2c4b 100644 --- a/README.md +++ b/README.md @@ -114,3 +114,10 @@ base + ``` + +## Code of Conduct + +Please note that the legendry project is released with a [Contributor +Code of +Conduct](https://teunbrand.github.io/legendry/CODE_OF_CONDUCT.html). By +contributing to this project, you agree to abide by its terms. From b56395dc9a1ac1600fe74c7946c18f3af2e64dd3 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Sat, 26 Oct 2024 12:54:00 +0200 Subject: [PATCH 3/3] Use yaml chunk headers --- README.Rmd | 15 ++++++++++----- vignettes/articles/guide_composition.Rmd | 15 ++++++++++----- vignettes/articles/keys.Rmd | 6 ++++-- vignettes/articles/tour.Rmd | 10 +++++++--- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/README.Rmd b/README.Rmd index 3922055..3c05f8a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -4,7 +4,8 @@ output: github_document -```{r, include = FALSE} +```{r} +#| include: false knitr::opts_chunk$set( collapse = TRUE, comment = "#>", @@ -41,7 +42,8 @@ devtools::install_github("teunbrand/legendry") Let's first set up a basic plot to experiment with: -```{r basic_plot} +```{r} +#| label: basic_plot library(legendry) base <- ggplot(mpg, aes(displ, hwy, colour = cty)) + @@ -61,7 +63,8 @@ In the example below, we're using two custom variants of vanilla guides, namely * The axis guide has an option for bidirectional ticks. * The colourbar automatically recognises out-of-bounds values and displays this with a cap. -```{r full_guides} +```{r} +#| label: full_guides base + scale_colour_viridis_c( limits = c(NA, 30), @@ -77,7 +80,8 @@ The `ggplot2::guide_axis_stack()` is an axis composition function that can be us Here, we use a 'primitive' guide (incomplete building block) to display a range on the axis. By stacking it with a regular axis the primitive guide is completed. -```{r primitives} +```{r} +#| label: primitives # A partial guide to display a bracket efficient_bracket <- primitive_bracket( # Keys determine what is displayed @@ -98,7 +102,8 @@ In the example below we compose a 'sandwich': a central guide flanked by two oth Because our bracket is a primitive, it does not matter what aesthetic it displays and we can re-use it for the sandwich. I've yet to write the vignette on composition. -```{r composition} +```{r} +#| label: composition base + scale_colour_viridis_c( guide = compose_sandwich( diff --git a/vignettes/articles/guide_composition.Rmd b/vignettes/articles/guide_composition.Rmd index 55ac6f7..0c8ff9f 100644 --- a/vignettes/articles/guide_composition.Rmd +++ b/vignettes/articles/guide_composition.Rmd @@ -2,7 +2,8 @@ title: "A guide to guide composition" --- -```{r, include = FALSE} +```{r} +#| include: false knitr::opts_chunk$set( collapse = TRUE, comment = "#>", @@ -10,7 +11,8 @@ knitr::opts_chunk$set( ) ``` -```{r setup} +```{r} +#| label: setup library(legendry) ``` @@ -135,14 +137,16 @@ last_plot() + By giving them the `primitive_`-prefix, we have made it impossible to use them by name inside function that don't expect them. This acts as a little bit of discouragement from using primitives as complete guides. -```{r, error=TRUE} +```{r} +#| error: true standard + guides(x.sec = "ticks") ``` However, you *can* use primitives by name inside guide composition functions, *or* use their full constructor function. -```{r, fig.keep = "last"} +```{r} +#| fig-keep: last standard + guides(x.sec = compose_stack("ticks")) @@ -187,7 +191,8 @@ last_plot() + theme(legend.text.position = "left") It should also be noted that if the guide has a label-supression mechanism, the 'opposite' guide will be drawn with surpressed labels. The mechanism is in place in guides like `guide_axis()`/`guide_axis_base()` for display in for example `facet_grid(axis.labels = "margins")`. -```{r, fig.keep = "last"} +```{r} +#| fig-keep: last standard + aes(colour = cty) + scale_colour_viridis_c( diff --git a/vignettes/articles/keys.Rmd b/vignettes/articles/keys.Rmd index 3886d65..81c036e 100644 --- a/vignettes/articles/keys.Rmd +++ b/vignettes/articles/keys.Rmd @@ -2,7 +2,8 @@ title: "Key information" --- -```{r, include = FALSE} +```{r} +#| include: false knitr::opts_chunk$set( collapse = TRUE, comment = "#>", @@ -10,7 +11,8 @@ knitr::opts_chunk$set( ) ``` -```{r setup} +```{r} +#| label: setup library(legendry) ``` diff --git a/vignettes/articles/tour.Rmd b/vignettes/articles/tour.Rmd index 259483b..a2cc496 100644 --- a/vignettes/articles/tour.Rmd +++ b/vignettes/articles/tour.Rmd @@ -2,14 +2,16 @@ title: "A guided tour" --- -```{r, include = FALSE} +```{r} +#| include: false knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` -```{r setup} +```{r} +#| label: setup library(legendry) library(scales) ``` @@ -265,7 +267,9 @@ In the plot below, the `cty` variable has a few observation below the lower limi Typically, these are displayed in the `na.value = "grey"` colour. The bars display that these data are out-of-bounds by the gray 'caps' at the two ends of the bar. -```{r, dev = 'png', dev.args=list(type = 'cairo')} +```{r} +#| dev-args: !expr list(type = "cairo") +#| fig-format: png standard + scale_colour_viridis_c( limits = c(10, 30),