Skip to content

Commit

Permalink
Upkeep (#29)
Browse files Browse the repository at this point in the history
* Add GitHub links to DESCRIPTION

* do upkeep bullets

* Use yaml chunk headers
  • Loading branch information
teunbrand authored Oct 26, 2024
1 parent cc01027 commit 0244721
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 32 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^pkgdown$
^vignettes/articles$
^codecov\.yml$
^CODE_OF_CONDUCT\.md$
7 changes: 5 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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")'
8 changes: 5 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -22,7 +24,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -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
Expand Down
126 changes: 126 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.

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
<https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.

[homepage]: https://www.contributor-covenant.org
23 changes: 11 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -31,9 +24,15 @@ Imports:
Suggests:
knitr,
ragg,
svglite,
rmarkdown,
svglite,
systemfonts,
testthat (>= 3.0.0),
vdiffr,
withr
VignetteBuilder:
knitr
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
19 changes: 14 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ output: github_document

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
Expand Down Expand Up @@ -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)) +
Expand All @@ -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),
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -109,3 +114,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.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ base +
```

<img src="man/figures/README-composition-1.svg" width="80%" style="display: block; margin: auto;" />

## 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.
15 changes: 10 additions & 5 deletions vignettes/articles/guide_composition.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
title: "A guide to guide composition"
---

```{r, include = FALSE}
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
dev = "ragg_png"
)
```

```{r setup}
```{r}
#| label: setup
library(legendry)
```

Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions vignettes/articles/keys.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
title: "Key information"
---

```{r, include = FALSE}
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
dev = "ragg_png"
)
```

```{r setup}
```{r}
#| label: setup
library(legendry)
```

Expand Down
10 changes: 7 additions & 3 deletions vignettes/articles/tour.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 0244721

Please sign in to comment.