Skip to content

Commit

Permalink
Merge pull request #15 from eodaGmbH/feature/progress_formatter
Browse files Browse the repository at this point in the history
Feature/progress formatter
  • Loading branch information
Friessn authored Sep 12, 2024
2 parents c446489 + ae544a5 commit 5cc1694
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions R/columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,33 @@ 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(
min = min,
max = max,
color = color,
legend = legend,
legendColor = legend_color,
legendAlign = legend_align
legendColor = legendColor,
legendAlign = legendAlign
),
hozAlign = hoz_align
)
Expand Down

0 comments on commit 5cc1694

Please sign in to comment.