Skip to content

Commit a1992b2

Browse files
Final UI/UX changes (#905)
Minor css cleanup --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4019aff commit a1992b2

File tree

11 files changed

+21
-168
lines changed

11 files changed

+21
-168
lines changed

R/tm_a_pca.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ ui_a_pca <- function(id, ...) {
229229
}
230230

231231
tagList(
232-
include_css_files("custom"),
233232
teal.widgets::standard_layout(
234233
output = teal.widgets::white_small_well(
235234
uiOutput(ns("all_plots"))

R/tm_data_table.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) {
158158
ns <- NS(id)
159159

160160
tagList(
161-
include_css_files("custom"),
162161
teal.widgets::standard_layout(
163162
output = teal.widgets::white_small_well(
164163
bslib::page_fluid(

R/tm_file_viewer.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,12 @@ ui_viewer <- function(id, ...) {
103103
ns <- NS(id)
104104

105105
tagList(
106-
include_css_files("custom"),
107106
teal.widgets::standard_layout(
108107
output = tags$div(
109108
uiOutput(ns("output"))
110109
),
111110
encoding = tags$div(
112-
class = "file_viewer_encoding",
111+
style = "overflow-y: hidden; overflow-x: auto;",
113112
tags$label("Encodings", class = "text-primary"),
114113
shinyTree::shinyTree(
115114
ns("tree"),
@@ -173,7 +172,7 @@ srv_viewer <- function(id, input_path) {
173172
tags$img(src = con_type$selected_path, alt = "file does not exist")
174173
} else if (file_extension == "pdf") {
175174
tags$embed(
176-
class = "embed_pdf",
175+
style = "height: 600px; width: 100%;",
177176
src = con_type$selected_path
178177
)
179178
} else if (!isFALSE(con_type$output_text[1])) {

R/tm_front_page.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,32 @@ ui_front_page <- function(id, ...) {
119119
ns <- NS(id)
120120

121121
tagList(
122-
include_css_files("custom"),
123122
tags$div(
124123
id = "front_page_content",
125-
class = "ml-8",
124+
style = "margin-left: 2rem;",
126125
tags$div(
127126
id = "front_page_headers",
128127
get_header_tags(args$header_text)
129128
),
130129
tags$div(
131130
id = "front_page_tables",
132-
class = "ml-4",
131+
style = "margin-left: 2rem;",
133132
get_table_tags(args$tables, ns)
134133
),
135134
tags$div(
136135
id = "front_page_custom_html",
137-
class = "my-4",
136+
style = "margin-left: 2rem;",
138137
args$additional_tags
139138
),
140139
if (length(args$datanames) > 0L) {
141140
tags$div(
142141
id = "front_page_metabutton",
143-
class = "m-4",
142+
style = "margin: 1rem;",
144143
actionButton(ns("metadata_button"), "Show metadata")
145144
)
146145
},
147146
tags$footer(
148-
class = ".small",
147+
class = "small",
149148
get_footer_tags(args$footnotes)
150149
)
151150
)
@@ -228,7 +227,7 @@ get_table_tags <- function(tables, ns) {
228227
tableOutput(ns(paste0("table_", idx)))
229228
)
230229
}))
231-
return(table_tags)
230+
table_tags
232231
}
233232

234233
get_footer_tags <- function(footnotes) {
@@ -255,11 +254,11 @@ convert_metadata_to_dataframe <- function(raw_metadata, datanames) {
255254
if (is.null(metadata)) {
256255
return(data.frame(Dataset = character(0), Name = character(0), Value = character(0)))
257256
}
258-
return(data.frame(
257+
data.frame(
259258
Dataset = dataname,
260259
Name = names(metadata),
261260
Value = unname(unlist(lapply(metadata, as.character)))
262-
))
261+
)
263262
}, raw_metadata, datanames, SIMPLIFY = FALSE)
264263
do.call(rbind, output)
265264
}

R/tm_g_scatterplot.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ ui_g_scatterplot <- function(id, ...) {
362362
)
363363

364364
tagList(
365-
include_css_files("custom"),
366365
teal.widgets::standard_layout(
367366
output = teal.widgets::white_small_well(
368367
teal.widgets::plot_with_settings_ui(id = ns("scatter_plot")),
369-
tags$h1(tags$strong("Selected points:"), class = "text-center font-150p"),
368+
tags$br(),
369+
tags$h1(tags$strong("Selected points:"), style = "font-size: 150%;"),
370370
teal.widgets::get_dt_rows(ns("data_table"), ns("data_table_rows")),
371371
DT::dataTableOutput(ns("data_table"), width = "100%")
372372
),
@@ -470,16 +470,16 @@ ui_g_scatterplot <- function(id, ...) {
470470
tags$div(
471471
id = ns("label_pos"),
472472
tags$div(tags$strong("Stats position")),
473-
tags$div(class = "inline-block w-10", helpText("Left")),
473+
tags$div(style = "display: inline-block; width: 70%;", helpText("Left")),
474474
tags$div(
475-
class = "inline-block w-70",
475+
style = "display: inline-block; width: 70%;",
476476
teal.widgets::optionalSliderInput(
477477
ns("pos"),
478478
label = NULL,
479479
min = 0, max = 1, value = .99, ticks = FALSE, step = .01
480480
)
481481
),
482-
tags$div(class = "inline-block w-10", helpText("Right"))
482+
tags$div(style = "display: inline-block; width: 10%;", helpText("Right"))
483483
),
484484
teal.widgets::optionalSliderInput(
485485
ns("label_size"), "Stats font size",

R/tm_missing_data.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ tm_missing_data <- function(label = "Missing data",
183183
ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
184184
ns <- NS(id)
185185
tagList(
186-
include_css_files("custom"),
187186
teal.widgets::standard_layout(
188187
output = teal.widgets::white_small_well(
189188
uiOutput(ns("dataset_tabs"))
@@ -372,9 +371,9 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
372371
uiOutput(ns("variables")),
373372
actionButton(
374373
ns("filter_na"),
375-
tags$span("Select only vars with missings", class = "whitespace-normal"),
374+
tags$span("Select only vars with missings", style = "white-space: normal;"),
376375
width = "100%",
377-
class = "mb-4"
376+
style = "margin-bottom: 1rem;"
378377
),
379378
conditionalPanel(
380379
is_tab_active_js(ns("summary_type"), "Summary"),

R/tm_variable_browser.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ ui_variable_browser <- function(id,
142142
ns <- NS(id)
143143

144144
tags$div(
145-
include_css_files("custom"),
146145
shinyjs::useShinyjs(),
147146
teal.widgets::standard_layout(
148147
output = tags$div(
@@ -156,8 +155,10 @@ ui_variable_browser <- function(id,
156155
})
157156
),
158157
teal.widgets::white_small_well(
158+
### Reporter
159159
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
160160
tags$br(), tags$br(),
161+
###
161162
uiOutput(ns("ui_histogram_display")),
162163
uiOutput(ns("ui_numeric_display")),
163164
teal.widgets::plot_with_settings_ui(ns("variable_plot")),
@@ -236,11 +237,11 @@ srv_variable_browser <- function(id,
236237
tabPanel(
237238
dataname,
238239
tags$div(
239-
class = "mt-4",
240+
style = "margin-top: 1rem;",
240241
textOutput(ns(paste0("dataset_summary_", dataname)))
241242
),
242243
tags$div(
243-
class = "mt-4",
244+
style = "margin-top: 1rem;",
244245
teal.widgets::get_dt_rows(
245246
ns(paste0("variable_browser_", dataname)),
246247
ns(paste0("variable_browser_", dataname, "_rows"))

R/utils.R

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -234,29 +234,6 @@ variable_type_icons <- function(var_type) {
234234
))
235235
}
236236

237-
#' Include `CSS` files from `/inst/css/` package directory to application header
238-
#'
239-
#' `system.file` should not be used to access files in other packages, it does
240-
#' not work with `devtools`. Therefore, we redefine this method in each package
241-
#' as needed. Thus, we do not export this method
242-
#'
243-
#' @param pattern (`character`) optional, regular expression to match the file names to be included.
244-
#'
245-
#' @return HTML code that includes `CSS` files.
246-
#' @keywords internal
247-
#'
248-
include_css_files <- function(pattern = "*") {
249-
css_files <- list.files(
250-
system.file("css", package = "teal.modules.general", mustWork = TRUE),
251-
pattern = pattern, full.names = TRUE
252-
)
253-
if (length(css_files) == 0) {
254-
return(NULL)
255-
}
256-
singleton(tags$head(lapply(css_files, includeCSS)))
257-
}
258-
259-
#' JavaScript condition to check if a specific tab is active
260237
#'
261238
#' @param id (`character(1)`) the id of the tab panel with tabs.
262239
#' @param name (`character(1)`) the name of the tab.

inst/css/custom.css

Lines changed: 0 additions & 79 deletions
This file was deleted.

man/include_css_files.Rd

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)