Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Sep 12, 2024
1 parent d87c989 commit 25e4d64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions R/columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ set_formatter_star <- function(widget, column, number_of_stars, hoz_align = "cen
#' Progress Formatter
#' @inheritParams set_formatter_html
#' @param min (numeric): The minimum value for progress bar.
#' If set to \code{NULL} the minimum value of the column is used.
#' If set to \code{NA} the minimum value of the column is used.
#' @param max (numeric): The maximum value for progress bar.
#' If set to \code{NULL} the maximum value of the column is used.
#' If set to \code{NA} the maximum value of the column is used.
#' @param max description
#' @param color (character): Either a single color or a vector of colors
#' @param legend (character, \code{TRUE}, JavaScript function): If set to \code{TRUE} the value of the cell is displayed.
Expand All @@ -224,18 +224,18 @@ set_formatter_star <- function(widget, column, number_of_stars, hoz_align = "cen
set_formatter_progress <- function(
widget,
column,
min = NULL,
max = NULL,
min = NA,
max = NA,
color = c("yellow", "orange", "red"),
legend = NA,
legend_color = "#000000",
legend_align = c("center", "left", "right", "justify"),
hoz_align = "left") {
if (is.null(min)) {
if (is.na(min)) {
min <- min(widget$x$data[column])
}

if (is.null(max)) {
if (is.na(max)) {
max <- max(widget$x$data[column])
}

Expand Down
6 changes: 3 additions & 3 deletions man/set_formatter_progress.Rd

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

0 comments on commit 25e4d64

Please sign in to comment.