Skip to content

Commit

Permalink
fixed zzz I think
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjbe committed Nov 4, 2024
1 parent 358caef commit 6a4172a
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RoxygenNote: 7.3.2
Imports:
colorspace,
dplyr,
ggplot2,
ggplot2 (>= 3.0.0),
gt,
rlang,
showtext,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(geom_path)
export(geom_point)
export(geom_step)
export(geom_text)
export(gt_ojo)
export(gt_okpi)
export(ojo_analyst_name_text)
export(ojo_gt_captions)
Expand Down
36 changes: 27 additions & 9 deletions R/ojo_gt.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,23 @@ gt_okpi <- function(data,
font = gt::google_font(font)
) |>
gt::tab_style(
style = gt::cell_text(weight = "bold",
color = ojothemes::okpi_red,
size = gt::px(font_size * 2)),
style = list(
gt::cell_text(weight = "bold",
color = ojothemes::okpi_red,
size = gt::px(font_size * 2)),
gt::css(padding.left = "10px",
border.left = paste0("10px solid ", okpi_red, ";"))
),
locations = gt::cells_title(groups = "title")
) |>
gt::tab_style(
style = gt::cell_text(style = "italic",
size = gt::px(font_size * 1.25)),
style = list(
gt::cell_text(style = "italic",
color = ojothemes::okpi_blue,
size = gt::px(font_size * 1.25)),
gt::css(padding.left = "10px",
border.left = paste0("10px solid ", okpi_red, ";"))
),
locations = gt::cells_title(groups = "subtitle")
) |>
gt::tab_style(
Expand Down Expand Up @@ -133,14 +142,23 @@ gt_ojo <- function(data,
font = gt::google_font(font)
) |>
gt::tab_style(
style = gt::cell_text(weight = "bold",
color = "#333333",
size = gt::px(font_size * 2)),
style = list(
gt::cell_text(weight = "bold",
color = "#333333",
size = gt::px(font_size * 2)),
# I think this little splash of color is nice
gt::css(padding.left = "10px",
border.left = paste0("10px solid ", okpi_yellow, ";"))
),
locations = gt::cells_title(groups = "title")
) |>
gt::tab_style(
style = gt::cell_text(style = "italic",
style = list(
gt::cell_text(style = "italic",
size = gt::px(font_size * 1.25)),
gt::css(padding.left = "10px",
border.left = paste0("10px solid ", okpi_yellow, ";"))
),
locations = gt::cells_title(groups = "subtitle")
) |>
gt::tab_style(
Expand Down
14 changes: 0 additions & 14 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,4 @@
sysfonts::font_add_google("Roboto Condensed")
showtext::showtext_auto()

# check ggplot2 version
if (unlist(utils::packageVersion("ggplot2"))[1] < 3) {
packageStartupMessage(
"Warning: ojothemes requires ggplot2 version 3.0.0 or higher."
)
}

# check that ggplot2 is already loaded
if (!"ggplot2" %in% (.packages())) {
packageStartupMessage(
"Warning: ggplot2 needs to be loaded before ojothemes is loaded. Consider restarting your R session."
)
}

}
45 changes: 45 additions & 0 deletions man/gt_ojo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a4172a

Please sign in to comment.