Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions R/makeChartConfig.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,28 @@ makeChartConfig <- function(dirs, sourceFiles=TRUE){
chart$order
) %>% as.numeric

#charts should be available to export unless the are modules or chart$export is set to false
chart$export <- ifelse(
is.null(chart$export),
TRUE,
chart$export
)

return(chart)
})

names(charts) <- yaml_files %>% file_path_sans_ext %>% basename
charts <- charts[order(purrr::map_dbl(charts, function(chart) chart$order))]
charts <- charts[order(purrr::map_dbl(charts, function(chart) chart$order))]

# Drop charts where order is negative
drops <- charts[purrr::map_lgl(charts, function(chart) chart$order < 0)]
if(length(drops)>0){
message("Dropped ", length(drops), " charts: ",paste(names(drops),collapse=", "))
message("To display these charts, set the `order` parameter in the chart object or yaml file to a positive number.")
charts <- charts[purrr::map_lgl(charts, function(chart) chart$order >= 0)]
}

message("Found ", length(yaml_files), " config files: ",paste(names(charts),collapse=", "))
message("Loaded ", length(charts), " charts: ",paste(names(charts),collapse=", "))

# Bind workflow functions to chart object
all_functions <- as.character(utils::lsf.str(".GlobalEnv"))
Expand Down
5 changes: 2 additions & 3 deletions R/mod_reportsTab.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ reportsTab <- function(input, output, session, charts, data, mapping){
# create checkbox for selecting charts of interest
output$checkboxes <- renderUI({
# no support for modules or broken widgets yet
noExport <- c("aeTimelines","hepexplorer","safetyShiftPlot","tplyr_shift")
chart_type <- charts %>% map(., ~.$type) %>% unlist
chart_name <- charts %>% map(., ~.$name) %>% unlist
charts_keep <- ((! chart_type == "module") & (! chart_name %in% noExport))
chart_export <- charts %>% map(., ~.$export) %>% unlist
charts_keep <- ((! chart_type == "module") & (chart_export))

charts_labels <- charts %>% map(., ~ .$label) %>% unlist
charts_vec <- names(charts)[charts_keep]
Expand Down
1 change: 0 additions & 1 deletion inst/report/safetyGraphicsReport.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ create_chart <- function(chart, params){
null = "null",
)
}
widgetParams$ns <-chart$name #Still not working quite right. May need to refactor widgets a bit to, since some use this parameter to select the location of the wrapper div. there's no easy way to set this to the random widget value (e.g. "htmlwidget-638ca0176b34007fbdf9")
return(widgetParams)
}

Expand Down