diff --git a/R/columns.R b/R/columns.R index 358cb1d..24acaad 100644 --- a/R/columns.R +++ b/R/columns.R @@ -154,15 +154,24 @@ set_star_formatter <- function(widget, column, number_of_stars, hoz_align = "cen # Progress #' @export + set_progress_formatter <- function( widget, column, - min = 0, - max = 10, + min = NULL, + max = NULL, color = c("green", "orange", "red"), - legend = FALSE, - legend_color = "#000000", - legend_align = "center", + legend = "", + legendColor = "#000000", + legendAlign = "center", hoz_align = "left") { + + + if (is.null(min)){ + min <- min(widget$x$data[column]) + } + if (is.null(max)){ + max <- max(widget$x$data[column]) + } col_update <- list( formatter = "progress", formatterParams = list( @@ -170,8 +179,8 @@ set_progress_formatter <- function( max = max, color = color, legend = legend, - legendColor = legend_color, - legendAlign = legend_align + legendColor = legendColor, + legendAlign = legendAlign ), hozAlign = hoz_align )