Skip to content

Commit 816312d

Browse files
authored
Merge branch 'main' into opt1_theme_classic_update
2 parents cd93462 + 3a7ae74 commit 816312d

File tree

192 files changed

+2009
-813
lines changed

Some content is hidden

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

192 files changed

+2009
-813
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: 1 addition & 2 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),
@@ -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: 3 additions & 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)
@@ -512,6 +513,8 @@ export(remove_missing)
512513
export(render_axes)
513514
export(render_strips)
514515
export(replace_theme)
516+
export(reset_geom_defaults)
517+
export(reset_stat_defaults)
515518
export(reset_theme_settings)
516519
export(resolution)
517520
export(scale_alpha)
@@ -727,8 +730,6 @@ import(gtable)
727730
import(rlang)
728731
import(scales)
729732
import(vctrs)
730-
importFrom(glue,glue)
731-
importFrom(glue,glue_collapse)
732733
importFrom(grid,arrow)
733734
importFrom(grid,unit)
734735
importFrom(lifecycle,deprecated)

NEWS.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
11
# ggplot2 (development version)
22

3-
* `theme_classic()` now has black ticks and text instead of dark gray. In
4-
addition, `theme_classic()`'s axis line end is `"square"` (@teunbrand, #5978).
3+
* New `reset_geom_defaults()` and `reset_stat_defaults()` to restore all geom or
4+
stat default aesthetics at once (@teunbrand, #5975).
5+
* `facet_wrap()` can have `space = "free_x"` with 1-row layouts and
6+
`space = "free_y"` with 1-column layouts (@teunbrand)
7+
* Secondary axes respect `n.breaks` setting in continuous scales (@teunbrand, #4483).
8+
* Layers can have names (@teunbrand, #4066).
9+
* (internal) improvements to `pal_qualitative()` (@teunbrand, #5013)
10+
* `coord_radial(clip = "on")` clips to the panel area when the graphics device
11+
supports clipping paths (@teunbrand, #5952).
12+
* (internal) Panel clipping responsibility moved from Facet class to Coord
13+
class through new `Coord$draw_panel()` method.
14+
* `theme(strip.clip)` now defaults to `"on"` and is independent of Coord
15+
clipping (@teunbrand, 5952).
16+
* (internal) rearranged the code of `Facet$draw_paensl()` method (@teunbrand).
17+
* Axis labels are now justified across facet panels (@teunbrand, #5820)
18+
* Fixed bug in `stat_function()` so x-axis title now produced automatically
19+
when no data added. (@phispu, #5647).
20+
* geom_sf now accepts shape names (@sierrajohnson, #5808)
21+
* Added `gg` class to `labs()` (@phispu, #5553).
22+
* Missing values from discrete palettes are no longer translated
23+
(@teunbrand, #5929).
24+
* Fixed bug in `facet_grid(margins = TRUE)` when using expresssions
25+
(@teunbrand, #1864).
26+
* `geom_step()` now supports the `orientation` argument (@teunbrand, #5936).
27+
* `position_dodge()` and `position_jitterdodge()` now have a `reverse` argument
28+
(@teunbrand, #3610)
29+
* `coord_radial(r.axis.inside)` can now take a numeric value to control
30+
placement of internally placed radius axes (@teunbrand, #5805).
31+
* (internal) default labels are derived in `ggplot_build()` rather than
32+
in `ggplot_add.Layer()` (@teunbrand, #5894)
33+
* An attempt is made to use a variable's label attribute as default label
34+
(@teunbrand, #4631)
35+
* Themes gain an additional `header_family` argument to easily set the font
36+
for headers and titles (#5886).
37+
* The `plot.subtitle`, `plot.caption` and `plot.tag` theme elements now inherit
38+
from the root `text` element instead of the `title` element (#5886).
39+
* ggplot2 no longer imports {glue} (@teunbrand, #5986).
40+
* `geom_rect()` can now derive the required corners positions from `x`/`width`
41+
or `y`/`height` parameterisation (@teunbrand, #5861).
542
* All position scales now use the same definition of `x` and `y` aesthetics.
643
This lets uncommon aesthetics like `xintercept` expand scales as usual.
744
(#3342, #4966, @teunbrand)
@@ -106,8 +143,21 @@
106143
the `nbin` argument (@teunbrand, #5882, #5036)
107144
* `after_stat()` and `after_scale()` throw warnings when the computed aesthetics
108145
are not of the correct length (#5901).
146+
* `guide_colourbar()` now correctly hands off `position` and `available_aes`
147+
parameters downstream (@teunbrand, #5930)
109148
* `geom_hline()` and `geom_vline()` now have `position` argument
110149
(@yutannihilation, #4285).
150+
* New function `get_strip_labels()` to retrieve facet labels (@teunbrand, #4979)
151+
* Fixed bug in `position_dodge2()`'s identification of range overlaps
152+
(@teunbrand, #5938, #4327).
153+
* Fixed bug where empty discrete scales weren't recognised as such
154+
(@teunbrand, #5945).
155+
* (internal) The summary function of `stat_summary()` and `stat_summary_bin()`
156+
is setup once in total instead of once per group (@teunbrand, #5971)
157+
* `facet_grid(space = "free")` can now be combined with `coord_fixed()`
158+
(@teunbrand, #4584).
159+
* `theme_classic()` now has black ticks and text instead of dark gray. In
160+
addition, `theme_classic()`'s axis line end is `"square"` (@teunbrand, #5978).
111161

112162
# ggplot2 3.5.1
113163

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/annotation-logticks.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
165165

166166
names(xticks)[names(xticks) == "value"] <- x_name # Rename to 'x' for coordinates$transform
167167
xticks <- coord$transform(xticks, panel_params)
168-
xticks = xticks[xticks$x <= 1 & xticks$x >= 0,]
168+
xticks <- xticks[xticks$x <= 1 & xticks$x >= 0,]
169169

170170
if (outside)
171171
xticks$end = -xticks$end
@@ -203,7 +203,7 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
203203

204204
names(yticks)[names(yticks) == "value"] <- y_name # Rename to 'y' for coordinates$transform
205205
yticks <- coord$transform(yticks, panel_params)
206-
yticks = yticks[yticks$y <= 1 & yticks$y >= 0,]
206+
yticks <- yticks[yticks$y <= 1 & yticks$y >= 0,]
207207

208208
if (outside)
209209
yticks$end = -yticks$end
@@ -238,7 +238,7 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
238238
# - start: on the other axis, start position of the line (usually 0)
239239
# - end: on the other axis, end position of the line (for example, .1, .2, or .3)
240240
calc_logticks <- function(base = 10, ticks_per_base = base - 1,
241-
minpow = 0, maxpow = minpow + 1, start = 0, shortend = .1, midend = .2, longend = .3) {
241+
minpow = 0, maxpow = minpow + 1, start = 0, shortend = 0.1, midend = 0.2, longend = 0.3) {
242242

243243
# Number of blocks of tick marks
244244
reps <- maxpow - minpow

0 commit comments

Comments
 (0)