Skip to content

Commit a284ec4

Browse files
authored
S7 theme element rewrite (#73)
* S7 theme element rewrite * news bullet and version bump * checks and pkgdown need ggplot2 dev version * adjust tests and expectations for ggplot2 v4 * ggpath dev version as well * update release bullets with new approach from nflfastR * update get started article
1 parent 7d43014 commit a284ec4

File tree

37 files changed

+389
-484
lines changed

37 files changed

+389
-484
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: r-lib/actions/setup-r-dependencies@v2
2727
with:
2828
extra-packages: any::covr, any::xml2
29-
needs: coverage
29+
needs: check
3030

3131
- name: Test coverage
3232
run: |

DESCRIPTION

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: nflplotR
22
Title: NFL Logo Plots in 'ggplot2' and 'gt'
3-
Version: 1.4.0.9003
3+
Version: 1.4.0.9004
44
Authors@R:
55
person("Sebastian", "Carl", , "[email protected]", role = c("aut", "cre"))
66
Description: A set of functions to visualize National Football League
@@ -14,16 +14,17 @@ Imports:
1414
cachem (>= 1.0.0),
1515
cli (>= 3.0.0),
1616
data.table (>= 1.14.0),
17-
ggpath (>= 1.0.1),
18-
ggplot2 (>= 3.3.0),
17+
ggpath (>= 1.0.2.9000),
18+
ggplot2 (>= 3.5.2),
1919
grid,
2020
gt (>= 0.8.0),
2121
lifecycle,
2222
magick (>= 2.7.3),
2323
memoise (>= 2.0.0),
2424
nflreadr (>= 1.3.2),
2525
rlang (>= 0.4.11),
26-
scales (>= 1.1.0)
26+
scales (>= 1.1.0),
27+
S7 (>= 0.2.0)
2728
Suggests:
2829
base64enc (>= 0.1-3),
2930
covr,
@@ -35,6 +36,12 @@ Suggests:
3536
vdiffr (>= 1.0.2),
3637
webshot2 (>= 0.1.1)
3738
Config/testthat/edition: 3
39+
Config/Needs/check:
40+
tidyverse/ggplot2,
41+
mrcaseb/ggpath
42+
Config/Needs/website:
43+
tidyverse/ggplot2,
44+
mrcaseb/ggpath
3845
Encoding: UTF-8
3946
Roxygen: list(markdown = TRUE)
4047
RoxygenNote: 7.3.2

NAMESPACE

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
S3method(element_grob,element_nfl_headshot)
4-
S3method(element_grob,element_nfl_logo)
5-
S3method(element_grob,element_nfl_wordmark)
6-
S3method(grobHeight,axisImageGrob)
7-
S3method(grobWidth,axisImageGrob)
83
export(.nflplotR_clear_cache)
94
export(GeomNFLheads)
105
export(GeomNFLlogo)
@@ -34,7 +29,9 @@ export(scale_fill_nfl)
3429
export(valid_team_names)
3530
import(data.table)
3631
import(grid)
37-
importFrom(ggplot2,element_grob)
32+
importFrom(ggpath,element_path)
33+
importFrom(ggplot2,draw_element)
34+
importFrom(ggplot2,element)
3835
importFrom(graphics,par)
3936
importFrom(lifecycle,deprecated)
4037
importFrom(nflreadr,nflverse_sitrep)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* All geoms and theme elements will print more informative warnings about team abbreviation, or player ID mismatches.
66
* The gt logo rendering functions now add alt text for accessibility and to silence an annoying pkgdown warning. (#69)
77
* nflplotR now requires R 4.1 because magick needs this R version. This also follows the [Tidyverse R version support rules](https://www.tidyverse.org/blog/2019/04/r-version-support/). (#71)
8+
* Rewrite theme elements in S7 to fully work with ggplot2 v4. This means nflplotR now requires ggplot2 v4! nflplotR is a ggplot2 extension and if ggplot2 version jumps make breaking changes, then it's best for the extension to not try to be downwards compatible. The theme system is now fully powered by ggpath. (#73)
89

910
# nflplotR 1.4.0
1011

R/nflplotR-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## usethis namespace: start
77
#' @import data.table
88
#' @import grid
9-
#' @importFrom ggplot2 element_grob
9+
#' @importFrom ggplot2 draw_element element
1010
#' @importFrom graphics par
1111
#' @importFrom lifecycle deprecated
1212
#' @importFrom rlang .data %||%

0 commit comments

Comments
 (0)