Skip to content

Commit 0a5e256

Browse files
authored
Merge branch 'main' into contour_rotation
2 parents fb2e4fe + 633e350 commit 0a5e256

File tree

150 files changed

+14663
-1617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+14663
-1617
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ on:
1010
pull_request:
1111
branches: [main, master]
1212

13-
name: R-CMD-check
13+
name: R-CMD-check.yaml
14+
15+
permissions: read-all
1416

1517
jobs:
1618
R-CMD-check:
@@ -25,15 +27,15 @@ jobs:
2527
- {os: macos-latest, r: 'release'}
2628

2729
- {os: windows-latest, r: 'release'}
28-
# use 4.1 to check with rtools40's older compiler
29-
- {os: windows-latest, r: '4.1'}
30+
# use 4.0 or 4.1 to check with rtools40's older compiler
31+
- {os: windows-latest, r: 'oldrel-4'}
3032

31-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
32-
- {os: ubuntu-latest, r: 'release'}
33-
- {os: ubuntu-latest, r: 'oldrel-1'}
34-
- {os: ubuntu-latest, r: 'oldrel-2'}
35-
- {os: ubuntu-latest, r: 'oldrel-3'}
36-
- {os: ubuntu-latest, r: 'oldrel-4'}
33+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
34+
- {os: ubuntu-latest, r: 'release'}
35+
- {os: ubuntu-latest, r: 'oldrel-1'}
36+
- {os: ubuntu-latest, r: 'oldrel-2'}
37+
- {os: ubuntu-latest, r: 'oldrel-3'}
38+
- {os: ubuntu-latest, r: 'oldrel-4'}
3739

3840
env:
3941
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -46,7 +48,7 @@ jobs:
4648
VDIFFR_LOG_PATH: "../vdiffr.Rout.fail"
4749

4850
steps:
49-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
5052

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

@@ -62,9 +64,10 @@ jobs:
6264
extra-packages: >
6365
any::rcmdcheck,
6466
Hmisc=?ignore-before-r=4.1.0,
65-
quantreg=?ignore-before-r=4.3.0,
67+
quantreg=?ignore-before-r=4.3.0
6668
needs: check
6769

6870
- uses: r-lib/actions/check-r-package@v2
6971
with:
7072
upload-snapshots: true
73+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
types: [published]
1010
workflow_dispatch:
1111

12-
name: pkgdown
12+
name: pkgdown.yaml
13+
14+
permissions: read-all
1315

1416
jobs:
1517
pkgdown:
@@ -19,8 +21,10 @@ jobs:
1921
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2022
env:
2123
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
2226
steps:
23-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2428

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

@@ -39,7 +43,7 @@ jobs:
3943

4044
- name: Deploy to GitHub pages 🚀
4145
if: github.event_name != 'pull_request'
42-
uses: JamesIves/github-pages-deploy-action@v4.4.1
46+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4347
with:
4448
clean: false
4549
branch: gh-pages

.github/workflows/pr-commands.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
issue_comment:
55
types: [created]
66

7-
name: Commands
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
810

911
jobs:
1012
document:
@@ -13,8 +15,10 @@ jobs:
1315
runs-on: ubuntu-latest
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
1620
steps:
17-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1822

1923
- uses: r-lib/actions/pr-fetch@v2
2024
with:
@@ -50,8 +54,10 @@ jobs:
5054
runs-on: ubuntu-latest
5155
env:
5256
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
5359
steps:
54-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
5561

5662
- uses: r-lib/actions/pr-fetch@v2
5763
with:

.github/workflows/test-coverage.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
test-coverage:
@@ -15,36 +17,45 @@ jobs:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618

1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921

2022
- uses: r-lib/actions/setup-r@v2
2123
with:
2224
use-public-rspm: true
2325

2426
- uses: r-lib/actions/setup-r-dependencies@v2
2527
with:
26-
extra-packages: any::covr
28+
extra-packages: any::covr, any::xml2
2729
needs: coverage
2830

2931
- name: Test coverage
3032
run: |
31-
covr::codecov(
33+
cov <- covr::package_coverage(
3234
quiet = FALSE,
3335
clean = FALSE,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3537
)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v4
42+
with:
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
3849
- name: Show testthat output
3950
if: always()
4051
run: |
4152
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4354
shell: bash
4455

4556
- name: Upload test results
4657
if: failure()
47-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
4859
with:
4960
name: coverage-test-failures
5061
path: ${{ runner.temp }}/package

CONTRIBUTING.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,19 @@ Each of these steps are described in more detail below. This might feel
6161
overwhelming the first time you get set up, but it gets easier with practice.
6262
If you get stuck at any point, please reach out for help on the [ggplot2-dev](https://groups.google.com/forum/#!forum/ggplot2-dev) mailing list.
6363

64-
If you're not familiar with git or github, please start by reading <http://r-pkgs.had.co.nz/git.html>
64+
If you're not familiar with git or github, please start by reading <https://r-pkgs.org/software-development-practices.html>
6565

6666
<!--
6767
* [ ] Motivate the change in one paragraph, and include it in NEWS.
6868
In parentheses, reference your github user name and this issue:
6969
`(@hadley, #1234)`
7070
* [ ] Check pull request only includes relevant changes.
71-
* [ ] Use the [official style](http://adv-r.had.co.nz/Style.html).
71+
* [ ] Use the [official style](https://style.tidyverse.org).
7272
* [ ] Update documentation and re-run roxygen2
7373
* [ ] Add test, if bug in non-graphical function
7474
* [ ] Add visual test, if bug in graphical function
7575
* [ ] Add minimal example, if new graphical feature
7676
77-
See http://docs.ggplot2.org/dev/vignettes/development.html for more details.
7877
--->
7978

8079
Pull requests will be evaluated against a seven point checklist:
@@ -100,20 +99,16 @@ Pull requests will be evaluated against a seven point checklist:
10099
and don't submit any others until the first one has been processed.
101100

102101
1. __Use ggplot2 coding style__. Please follow the
103-
[official tidyverse style](http://style.tidyverse.org). Maintaining
102+
[official tidyverse style](https://style.tidyverse.org). Maintaining
104103
a consistent style across the whole code base makes it much easier to
105104
jump into the code. If you're modifying existing ggplot2 code that
106105
doesn't follow the style guide, a separate pull request to fix the
107106
style would be greatly appreciated.
108107

109108
1. If you're adding new parameters or a new function, you'll also need
110-
to document them with [roxygen](https://github.com/klutometis/roxygen).
109+
to document them with [roxygen2](https://github.com/r-lib/roxygen2).
111110
Make sure to re-run `devtools::document()` on the code before submitting.
112111

113-
Currently, ggplot2 uses the development version of roxygen2, which you
114-
can get with `install_github("klutometis/roxygen")`. This will be
115-
available on CRAN in the near future.
116-
117112
1. If fixing a bug or adding a new feature to a non-graphical function,
118113
please add a [testthat](https://github.com/r-lib/testthat) unit test.
119114

DESCRIPTION

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Depends:
3333
R (>= 3.5)
3434
Imports:
3535
cli,
36-
glue,
3736
grDevices,
3837
grid,
3938
gtable (>= 0.1.1),
@@ -67,7 +66,7 @@ Suggests:
6766
rpart,
6867
sf (>= 0.7-3),
6968
svglite (>= 2.1.2),
70-
testthat (>= 3.1.2),
69+
testthat (>= 3.1.5),
7170
vdiffr (>= 1.0.6),
7271
xml2
7372
Enhances:
@@ -79,7 +78,7 @@ Config/testthat/edition: 3
7978
Encoding: UTF-8
8079
LazyData: true
8180
Roxygen: list(markdown = TRUE)
82-
RoxygenNote: 7.3.1
81+
RoxygenNote: 7.3.2
8382
Collate:
8483
'ggproto.R'
8584
'ggplot-global.R'

NAMESPACE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ export(get_last_plot)
427427
export(get_layer_data)
428428
export(get_layer_grob)
429429
export(get_panel_scales)
430+
export(get_strip_labels)
430431
export(get_theme)
431432
export(gg_dep)
432433
export(gg_par)
@@ -727,8 +728,6 @@ import(gtable)
727728
import(rlang)
728729
import(scales)
729730
import(vctrs)
730-
importFrom(glue,glue)
731-
importFrom(glue,glue_collapse)
732731
importFrom(grid,arrow)
733732
importFrom(grid,unit)
734733
importFrom(lifecycle,deprecated)

NEWS.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,43 @@
22

33
* `geom_contour()` should be able to recognise a rotated grid of points
44
(@teunbrand, #4320)
5+
* Fixed bug in `stat_function()` so x-axis title now produced automatically
6+
when no data added. (@phispu, #5647).
7+
* geom_sf now accepts shape names (@sierrajohnson, #5808)
8+
* Added `gg` class to `labs()` (@phispu, #5553).
9+
* Missing values from discrete palettes are no longer translated
10+
(@teunbrand, #5929).
11+
* Fixed bug in `facet_grid(margins = TRUE)` when using expresssions
12+
(@teunbrand, #1864).
13+
* `geom_step()` now supports the `orientation` argument (@teunbrand, #5936).
14+
* `position_dodge()` and `position_jitterdodge()` now have a `reverse` argument
15+
(@teunbrand, #3610)
16+
* `coord_radial(r.axis.inside)` can now take a numeric value to control
17+
placement of internally placed radius axes (@teunbrand, #5805).
18+
* (internal) default labels are derived in `ggplot_build()` rather than
19+
in `ggplot_add.Layer()` (@teunbrand, #5894)
20+
* An attempt is made to use a variable's label attribute as default label
21+
(@teunbrand, #4631)
22+
* Themes gain an additional `header_family` argument to easily set the font
23+
for headers and titles (#5886).
24+
* The `plot.subtitle`, `plot.caption` and `plot.tag` theme elements now inherit
25+
from the root `text` element instead of the `title` element (#5886).
26+
* ggplot2 no longer imports {glue} (@teunbrand, #5986).
27+
* `geom_rect()` can now derive the required corners positions from `x`/`width`
28+
or `y`/`height` parameterisation (@teunbrand, #5861).
29+
* All position scales now use the same definition of `x` and `y` aesthetics.
30+
This lets uncommon aesthetics like `xintercept` expand scales as usual.
31+
(#3342, #4966, @teunbrand)
32+
* Bare numeric values provided to Date or Datetime scales get inversely
33+
transformed (cast to Date/POSIXct) with a warning (@teunbrand).
34+
* `stat_bin()` now accepts functions for argument `breaks` (@aijordan, #4561)
35+
* (internal) The plot's layout now has a coord parameter that is used to
36+
prevent setting up identical panel parameters (#5427)
37+
* (internal) rearranged the code of `Facet$draw_panels()` method (@teunbrand).
38+
* `geom_rug()` prints a warning when `na.rm = FALSE`, as per documentation (@pn317, #5905)
39+
* `position_dodge(preserve = "single")` now handles multi-row geoms better,
40+
such as `geom_violin()` (@teunbrand based on @clauswilke's work, #2801).
41+
* `position_jitterdodge()` now dodges by `group` (@teunbrand, #3656)
542
* The `arrow.fill` parameter is now applied to more line-based functions:
643
`geom_path()`, `geom_line()`, `geom_step()` `geom_function()`, line
744
geometries in `geom_sf()` and `element_line()`.
@@ -46,7 +83,8 @@
4683
* (Internal) Applying defaults in `geom_sf()` has moved from the internal
4784
`sf_grob()` to `GeomSf$use_defaults()` (@teunbrand).
4885
* `facet_wrap()` has new options for the `dir` argument to more precisely
49-
control panel directions (@teunbrand, #5212)
86+
control panel directions. Internally `dir = "h"` or `dir = "v"` is deprecated
87+
(@teunbrand, #5212).
5088
* Prevented `facet_wrap(..., drop = FALSE)` from throwing spurious errors when
5189
a character facetting variable contained `NA`s (@teunbrand, #5485).
5290
* When facets coerce the faceting variables to factors, the 'ordered' class
@@ -92,6 +130,15 @@
92130
the `nbin` argument (@teunbrand, #5882, #5036)
93131
* `after_stat()` and `after_scale()` throw warnings when the computed aesthetics
94132
are not of the correct length (#5901).
133+
* `guide_colourbar()` now correctly hands off `position` and `available_aes`
134+
parameters downstream (@teunbrand, #5930)
135+
* `geom_hline()` and `geom_vline()` now have `position` argument
136+
(@yutannihilation, #4285).
137+
* New function `get_strip_labels()` to retrieve facet labels (@teunbrand, #4979)
138+
* Fixed bug in `position_dodge2()`'s identification of range overlaps
139+
(@teunbrand, #5938, #4327).
140+
* Fixed bug where empty discrete scales weren't recognised as such
141+
(@teunbrand, #5945).
95142

96143
# ggplot2 3.5.1
97144

R/aes-evaluation.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ is_calculated <- function(x, warn = FALSE) {
231231
} else if (is.symbol(x)) {
232232
res <- is_dotted_var(as.character(x))
233233
if (res && warn) {
234-
what <- I(glue("The dot-dot notation (`{x}`)"))
234+
what <- I(paste0("The dot-dot notation (`", x, "`)"))
235235
var <- gsub(match_calculated_aes, "\\1", as.character(x))
236-
with <- I(glue("`after_stat({var})`"))
236+
with <- I(paste0("`after_stat(", var, ")`"))
237237
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-dot-dot")
238238
}
239239
res
@@ -242,9 +242,9 @@ is_calculated <- function(x, warn = FALSE) {
242242
} else if (is.call(x)) {
243243
if (identical(x[[1]], quote(stat))) {
244244
if (warn) {
245-
what <- I(glue("`{expr_deparse(x)}`"))
245+
what <- I(paste0("`", expr_deparse(x), "`"))
246246
x[[1]] <- quote(after_stat)
247-
with <- I(glue("`{expr_deparse(x)}`"))
247+
with <- I(paste0("`", expr_deparse(x), "`"))
248248
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-stat")
249249
}
250250
TRUE

R/coord-.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ Coord <- ggproto("Coord",
196196
},
197197

198198
setup_layout = function(layout, params) {
199+
# We're appending a COORD variable to the layout that determines the
200+
# uniqueness of panel parameters. The layout uses this to prevent redundant
201+
# setups of these parameters.
202+
scales <- layout[c("SCALE_X", "SCALE_Y")]
203+
layout$COORD <- vec_match(scales, unique0(scales))
199204
layout
200205
},
201206

0 commit comments

Comments
 (0)