Skip to content

Commit

Permalink
update images/docs for gt_plt_bar_pct
Browse files Browse the repository at this point in the history
  • Loading branch information
jthomasmock committed Sep 9, 2023
1 parent 23b8924 commit b38849c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
32 changes: 19 additions & 13 deletions R/gt-bar-html.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@
#' @section Examples:
#' ```r
#' library(gt)
#' gt_bar_plot_tab <- mtcars %>%
#' head() %>%
#' dplyr::select(cyl, mpg) %>%
#' dplyr::mutate(mpg_pct_max = round(mpg/max(mpg) * 100, digits = 2),
#' mpg_scaled = mpg/max(mpg) * 100) %>%
#' dplyr::mutate(mpg_unscaled = mpg) %>%
#' gt() %>%
#' gt_plt_bar_pct(column = mpg_scaled, scaled = TRUE) %>%
#' gt_plt_bar_pct(column = mpg_unscaled, scaled = FALSE,
#' fill = "blue", background = "lightblue") %>%
#' cols_align("center", contains("scale")) %>%
#' cols_width(4 ~ px(125),
#' 5 ~ px(125))
#'
#' base_tab <- dplyr::tibble(x = seq(1, 100, length.out = 6)) %>%
#' dplyr::mutate(
#' x_unscaled = x,
#' x_scaled = x / max(x) * 100
#' ) %>%
#' gt()
#'
#' base_tab %>%
#' gt_plt_bar_pct(
#' column = x_unscaled,
#' scaled = TRUE,
#' fill = "forestgreen"
#' ) %>%
#' gt_plt_bar_pct(
#' column = x_scaled,
#' scaled = FALSE,
#' labels = TRUE
#' )
#' ```
#' @section Figures:
#' \if{html}{\figure{gt_bar_plot.png}{options: width=100\%}}
Expand Down
Binary file modified man/figures/gt_bar_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/gt_bar_plot_label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 20 additions & 14 deletions man/gt_plt_bar_pct.Rd

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

0 comments on commit b38849c

Please sign in to comment.