minor adjustments

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-04-08 13:45:07 +02:00
commit 65327a4879
No known key found for this signature in database
8 changed files with 69 additions and 27 deletions

View file

@ -71,7 +71,11 @@ add_sparkline <- function(grid, column = "vals", color.main = "#2a8484", color.s
column = column,
renderer = function(data) {
data_cl <- class(data)
if (identical(data_cl, "factor")) {
if (all(sapply(data,is.na))){
type <- "line"
ds <- data.frame(x = NA, y = NA)
horizontal <- FALSE
} else if (identical(data_cl, "factor")) {
type <- "column"
s <- summary(data)
ds <- data.frame(x = names(s), y = s)