Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 0 additions & 2 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,13 @@ ui_a_pca <- function(id, ...) {
}

tagList(
include_css_files("custom"),
teal.widgets::standard_layout(
output = teal.widgets::white_small_well(
uiOutput(ns("all_plots"))
),
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args["dat"]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ ui_a_regression <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"), tags$br(),
teal.transform::datanames_input(args[c("response", "regressor")]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_data_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) {
ns <- NS(id)

tagList(
include_css_files("custom"),
teal.widgets::standard_layout(
output = teal.widgets::white_small_well(
bslib::page_fluid(
Expand Down
5 changes: 2 additions & 3 deletions R/tm_file_viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ ui_viewer <- function(id, ...) {
ns <- NS(id)

tagList(
include_css_files("custom"),
teal.widgets::standard_layout(
output = tags$div(
uiOutput(ns("output"))
),
encoding = tags$div(
class = "file_viewer_encoding",
style = "overflow-y: hidden; overflow-x: auto;",
tags$label("Encodings", class = "text-primary"),
shinyTree::shinyTree(
ns("tree"),
Expand Down Expand Up @@ -173,7 +172,7 @@ srv_viewer <- function(id, input_path) {
tags$img(src = con_type$selected_path, alt = "file does not exist")
} else if (file_extension == "pdf") {
tags$embed(
class = "embed_pdf",
style = "height: 600px; width: 100%;",
src = con_type$selected_path
)
} else if (!isFALSE(con_type$output_text[1])) {
Expand Down
17 changes: 8 additions & 9 deletions R/tm_front_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,32 @@ ui_front_page <- function(id, ...) {
ns <- NS(id)

tagList(
include_css_files("custom"),
tags$div(
id = "front_page_content",
class = "ml-8",
style = "margin-left: 2rem;",
tags$div(
id = "front_page_headers",
get_header_tags(args$header_text)
),
tags$div(
id = "front_page_tables",
class = "ml-4",
style = "margin-left: 2rem;",
get_table_tags(args$tables, ns)
),
tags$div(
id = "front_page_custom_html",
class = "my-4",
style = "margin-left: 2rem;",
args$additional_tags
),
if (length(args$datanames) > 0L) {
tags$div(
id = "front_page_metabutton",
class = "m-4",
style = "margin: 1rem;",
actionButton(ns("metadata_button"), "Show metadata")
)
},
tags$footer(
class = ".small",
class = "small",
get_footer_tags(args$footnotes)
)
)
Expand Down Expand Up @@ -228,7 +227,7 @@ get_table_tags <- function(tables, ns) {
tableOutput(ns(paste0("table_", idx)))
)
}))
return(table_tags)
table_tags
}

get_footer_tags <- function(footnotes) {
Expand All @@ -255,11 +254,11 @@ convert_metadata_to_dataframe <- function(raw_metadata, datanames) {
if (is.null(metadata)) {
return(data.frame(Dataset = character(0), Name = character(0), Value = character(0)))
}
return(data.frame(
data.frame(
Dataset = dataname,
Name = names(metadata),
Value = unname(unlist(lapply(metadata, as.character)))
))
)
}, raw_metadata, datanames, SIMPLIFY = FALSE)
do.call(rbind, output)
}
1 change: 0 additions & 1 deletion R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ ui_tm_g_association <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("ref", "vars")]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ ui_g_bivariate <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x", "y", "row_facet", "col_facet", "color", "fill", "size")]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ ui_distribution <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("dist_var", "strata_var")]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ ui_g_response <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("response", "x", "row_facet", "col_facet")]),
Expand Down
10 changes: 4 additions & 6 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,16 @@ ui_g_scatterplot <- function(id, ...) {
)

tagList(
include_css_files("custom"),
teal.widgets::standard_layout(
output = teal.widgets::white_small_well(
teal.widgets::plot_with_settings_ui(id = ns("scatter_plot")),
tags$h1(tags$strong("Selected points:"), class = "text-center font-150p"),
tags$h1(tags$strong("Selected points:"), style = "text-align: center !important; font-size: 150%;"),
teal.widgets::get_dt_rows(ns("data_table"), ns("data_table_rows")),
DT::dataTableOutput(ns("data_table"), width = "100%")
),
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("x", "y", "color_by", "size_by", "row_facet", "col_facet")]),
Expand Down Expand Up @@ -470,16 +468,16 @@ ui_g_scatterplot <- function(id, ...) {
tags$div(
id = ns("label_pos"),
tags$div(tags$strong("Stats position")),
tags$div(class = "inline-block w-10", helpText("Left")),
tags$div(style = "display: inline-block; width: 70%;", helpText("Left")),
tags$div(
class = "inline-block w-70",
style = "display: inline-block; width: 70%;",
teal.widgets::optionalSliderInput(
ns("pos"),
label = NULL,
min = 0, max = 1, value = .99, ticks = FALSE, step = .01
)
),
tags$div(class = "inline-block w-10", helpText("Right"))
tags$div(style = "display: inline-block; width: 10%;", helpText("Right"))
),
teal.widgets::optionalSliderInput(
ns("label_size"), "Stats font size",
Expand Down
1 change: 0 additions & 1 deletion R/tm_g_scatterplotmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ ui_g_scatterplotmatrix <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args$variables),
Expand Down
6 changes: 2 additions & 4 deletions R/tm_missing_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ tm_missing_data <- function(label = "Missing data",
ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
ns <- NS(id)
tagList(
include_css_files("custom"),
teal.widgets::standard_layout(
output = teal.widgets::white_small_well(
uiOutput(ns("dataset_tabs"))
Expand Down Expand Up @@ -362,7 +361,6 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
tagList(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
helpText(
Expand All @@ -372,9 +370,9 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
uiOutput(ns("variables")),
actionButton(
ns("filter_na"),
tags$span("Select only vars with missings", class = "whitespace-normal"),
tags$span("Select only vars with missings", style = "white-space: normal;"),
width = "100%",
class = "mb-4"
style = "margin-bottom: 1rem;"
),
conditionalPanel(
is_tab_active_js(ns("summary_type"), "Summary"),
Expand Down
1 change: 0 additions & 1 deletion R/tm_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ ui_outliers <- function(id, ...) {
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(args[c("outlier_var", "categorical_var")]),
Expand Down
1 change: 0 additions & 1 deletion R/tm_t_crosstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ ui_t_crosstable <- function(id, x, y, show_percentage, show_total, remove_zero_c
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
tags$label("Encodings", class = "text-primary"),
teal.transform::datanames_input(list(x, y)),
Expand Down
6 changes: 2 additions & 4 deletions R/tm_variable_browser.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ ui_variable_browser <- function(id,
ns <- NS(id)

tags$div(
include_css_files("custom"),
shinyjs::useShinyjs(),
teal.widgets::standard_layout(
output = tags$div(
Expand All @@ -157,7 +156,6 @@ ui_variable_browser <- function(id,
),
teal.widgets::white_small_well(
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
uiOutput(ns("ui_histogram_display")),
uiOutput(ns("ui_numeric_display")),
teal.widgets::plot_with_settings_ui(ns("variable_plot")),
Expand Down Expand Up @@ -236,11 +234,11 @@ srv_variable_browser <- function(id,
tabPanel(
dataname,
tags$div(
class = "mt-4",
style = "margin-top: 1rem;",
textOutput(ns(paste0("dataset_summary_", dataname)))
),
tags$div(
class = "mt-4",
style = "margin-top: 1rem;",
teal.widgets::get_dt_rows(
ns(paste0("variable_browser_", dataname)),
ns(paste0("variable_browser_", dataname, "_rows"))
Expand Down
23 changes: 0 additions & 23 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,29 +234,6 @@ variable_type_icons <- function(var_type) {
))
}

#' Include `CSS` files from `/inst/css/` package directory to application header
#'
#' `system.file` should not be used to access files in other packages, it does
#' not work with `devtools`. Therefore, we redefine this method in each package
#' as needed. Thus, we do not export this method
#'
#' @param pattern (`character`) optional, regular expression to match the file names to be included.
#'
#' @return HTML code that includes `CSS` files.
#' @keywords internal
#'
include_css_files <- function(pattern = "*") {
css_files <- list.files(
system.file("css", package = "teal.modules.general", mustWork = TRUE),
pattern = pattern, full.names = TRUE
)
if (length(css_files) == 0) {
return(NULL)
}
singleton(tags$head(lapply(css_files, includeCSS)))
}

#' JavaScript condition to check if a specific tab is active
#'
#' @param id (`character(1)`) the id of the tab panel with tabs.
#' @param name (`character(1)`) the name of the tab.
Expand Down
79 changes: 0 additions & 79 deletions inst/css/custom.css

This file was deleted.

Loading
Loading