Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nflplotR
Title: NFL Logo Plots in 'ggplot2' and 'gt'
Version: 1.4.0.9001
Version: 1.4.0.9002
Authors@R:
person("Sebastian", "Carl", , "mrcaseb@gmail.com", role = c("aut", "cre"))
Description: A set of functions to visualize National Football League
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Updated the New York Jets logo (again) to their new secondary logo introduced in the 2024 off-season. This aligns with the logo used across nfl dot com and it has been voted for in a poll. (#68)
* The theme elements `element_nfl_logo()` and `element_nfl_wordmark()` now clean team abbreviations by calling `nflreadr::clean_team_abbrs()` and insert empty grobs for mismatches.
* All geoms and theme elements will print more informative warnings about team abbreviation, or player ID mismatches.
* The gt logo rendering functions now add alt text for accessibility and to silence an annoying pkgdown warning. (#69)

# nflplotR 1.4.0

Expand Down
20 changes: 18 additions & 2 deletions R/gt_nfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@
# Create the image URI
uri <- get_image_uri(team_abbr = team_abbr, type = type)
# Generate the Base64-encoded image and place it within <img> tags
out <- paste0("<img src=\"", uri, "\" style=\"height:", height, ";\">")
out <- paste0(
"<img src=\"",
uri,
"\" style=\"height:",
height,
";\" alt=\"The ",
team_abbr,
" NFL logo\">"
)

Check warning on line 151 in R/gt_nfl.R

View check run for this annotation

Codecov / codecov/patch

R/gt_nfl.R#L143-L151

Added lines #L143 - L151 were not covered by tests
# If the image uri returns NA we didn't find a match. We will return the
# actual value then to avoid removing a label
out[is.na(uri)] <- x[is.na(uri)]
Expand Down Expand Up @@ -176,7 +184,15 @@
# Create the image URI
uri <- get_image_uri(team_abbr = team_abbr, type = type)
# Generate the Base64-encoded image and place it within <img> tags
out <- paste0("<img src=\"", uri, "\" style=\"height:", height, ";\">")
out <- paste0(
"<img src=\"",
uri,
"\" style=\"height:",
height,
";\" alt=\"The ",
team_abbr,
" NFL logo\">"
)

Check warning on line 195 in R/gt_nfl.R

View check run for this annotation

Codecov / codecov/patch

R/gt_nfl.R#L187-L195

Added lines #L187 - L195 were not covered by tests
out <- lapply(out, gt::html)
# If the image uri returns NA we didn't find a match. We will return the
# actual value then to allow the user to call gt::sub_missing()
Expand Down
1 change: 1 addition & 0 deletions nflplotR.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 4cc57ef7-8811-41ca-a4f1-12c67158ba76

RestoreWorkspace: No
SaveWorkspace: No
Expand Down
Loading