Skip to content

Commit a4ee004

Browse files
committed
feat: ui changes
1 parent b25eaee commit a4ee004

File tree

4 files changed

+62
-93
lines changed

4 files changed

+62
-93
lines changed

R/tm_data_table.R

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,15 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) {
161161
include_css_files("custom"),
162162
teal.widgets::standard_layout(
163163
output = teal.widgets::white_small_well(
164-
fluidRow(
165-
column(
166-
width = 12,
167-
checkboxInput(
168-
ns("if_distinct"),
169-
"Show only distinct rows:",
170-
value = FALSE
171-
)
164+
bslib::page_fluid(
165+
checkboxInput(
166+
ns("if_distinct"),
167+
"Show only distinct rows:",
168+
value = FALSE
172169
)
173170
),
174-
fluidRow(
175-
class = "mb-8",
176-
column(
177-
width = 12,
178-
uiOutput(ns("dataset_table"))
179-
)
171+
bslib::page_fluid(
172+
uiOutput(ns("dataset_table"))
180173
)
181174
),
182175
pre_output = pre_output,
@@ -233,15 +226,12 @@ srv_page_data_table <- function(id,
233226
}
234227
tabPanel(
235228
title = x,
236-
column(
237-
width = 12,
238-
div(
239-
class = "mt-4",
240-
ui_data_table(
241-
id = session$ns(x),
242-
choices = choices,
243-
selected = variables_selected
244-
)
229+
bslib::layout_columns(
230+
col_widths = 12,
231+
ui_data_table(
232+
id = session$ns(x),
233+
choices = choices,
234+
selected = variables_selected
245235
)
246236
)
247237
)
@@ -281,7 +271,7 @@ ui_data_table <- function(id, choices, selected) {
281271

282272
tagList(
283273
teal.widgets::get_dt_rows(ns("data_table"), ns("dt_rows")),
284-
fluidRow(
274+
bslib::page_fluid(
285275
teal.widgets::optionalSelectInput(
286276
ns("variables"),
287277
"Select variables:",
@@ -291,7 +281,7 @@ ui_data_table <- function(id, choices, selected) {
291281
width = "100%"
292282
)
293283
),
294-
fluidRow(
284+
bslib::page_fluid(
295285
DT::dataTableOutput(ns("data_table"), width = "100%")
296286
)
297287
)

R/tm_g_bivariate.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,12 @@ ui_g_bivariate <- function(id, ...) {
372372
if (!is.null(args$row_facet) || !is.null(args$col_facet)) {
373373
tags$div(
374374
class = "data-extract-box",
375-
tags$label("Facetting"),
376-
shinyWidgets::switchInput(inputId = ns("facetting"), value = args$facet, size = "mini"),
375+
tags$br(),
376+
bslib::input_switch(
377+
id = ns("facetting"),
378+
label = "Facetting",
379+
value = args$facet
380+
),
377381
conditionalPanel(
378382
condition = paste0("input['", ns("facetting"), "']"),
379383
tags$div(
@@ -404,7 +408,11 @@ ui_g_bivariate <- function(id, ...) {
404408
tags$div(
405409
class = "data-extract-box",
406410
tags$label("Color settings"),
407-
shinyWidgets::switchInput(inputId = ns("coloring"), value = TRUE, size = "mini"),
411+
bslib::input_switch(
412+
id = ns("coloring"),
413+
label = "Color settings",
414+
value = TRUE
415+
),
408416
conditionalPanel(
409417
condition = paste0("input['", ns("coloring"), "']"),
410418
tags$div(

R/tm_missing_data.R

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,7 @@ ui_page_missing_data <- function(id, pre_output = NULL, post_output = NULL) {
186186
include_css_files("custom"),
187187
teal.widgets::standard_layout(
188188
output = teal.widgets::white_small_well(
189-
tags$div(
190-
class = "flex",
191-
column(
192-
width = 12,
193-
uiOutput(ns("dataset_tabs"))
194-
)
195-
)
189+
uiOutput(ns("dataset_tabs"))
196190
),
197191
encoding = tags$div(
198192
uiOutput(ns("dataset_encodings"))
@@ -230,13 +224,7 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, dataname
230224
function(x) {
231225
tabPanel(
232226
title = x,
233-
column(
234-
width = 12,
235-
tags$div(
236-
class = "mt-4",
237-
ui_missing_data(id = ns(x), by_subject_plot = if_subject_plot)
238-
)
239-
)
227+
ui_missing_data(id = ns(x), by_subject_plot = if_subject_plot)
240228
)
241229
}
242230
)
@@ -389,34 +377,30 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
389377
),
390378
conditionalPanel(
391379
is_tab_active_js(ns("summary_type"), "Summary"),
392-
checkboxInput(
393-
ns("any_na"),
394-
tags$div(
395-
tagList(
396-
"Add **anyna** variable",
397-
bslib::tooltip(
398-
icon("circle-info"),
399-
tags$span(
400-
"Describes the number of observations with at least one missing value in any variable."
401-
)
380+
bslib::input_switch(
381+
id = ns("any_na"),
382+
label = tags$div(
383+
HTML("Add <b>anyna</b> variable"),
384+
bslib::tooltip(
385+
icon("circle-info"),
386+
tags$span(
387+
"Describes the number of observations with at least one missing value in any variable."
402388
)
403389
)
404390
),
405391
value = FALSE
406392
),
407393
if (summary_per_patient) {
408-
checkboxInput(
409-
ns("if_patients_plot"),
410-
tags$div(
411-
tagList(
412-
"Add summary per patients",
413-
bslib::tooltip(
414-
icon("circle-info"),
415-
tags$span(
416-
paste(
417-
"Displays the number of missing values per observation,",
418-
"where the x-axis is sorted by observation appearance in the table."
419-
)
394+
bslib::input_switch(
395+
id = ns("if_patients_plot"),
396+
label = tags$div(
397+
"Add summary per patients",
398+
bslib::tooltip(
399+
icon("circle-info"),
400+
tags$span(
401+
paste(
402+
"Displays the number of missing values per observation,",
403+
"where the x-axis is sorted by observation appearance in the table."
420404
)
421405
)
422406
)

R/tm_variable_browser.R

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,11 @@ ui_variable_browser <- function(id,
156156
})
157157
),
158158
teal.widgets::white_small_well(
159-
### Reporter
160159
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
161-
###
162-
tags$div(
163-
class = "block",
164-
uiOutput(ns("ui_histogram_display"))
165-
),
166-
tags$div(
167-
class = "block",
168-
uiOutput(ns("ui_numeric_display"))
169-
),
160+
uiOutput(ns("ui_histogram_display")),
161+
uiOutput(ns("ui_numeric_display")),
170162
teal.widgets::plot_with_settings_ui(ns("variable_plot")),
171163
tags$br(),
172-
# input user-defined text size
173164
teal.widgets::panel_item(
174165
title = "Plot settings",
175166
collapsed = TRUE,
@@ -178,15 +169,16 @@ ui_variable_browser <- function(id,
178169
choices = ggplot_themes,
179170
selected = "grey"
180171
),
181-
fluidRow(
182-
column(6, sliderInput(
172+
bslib::layout_columns(
173+
col_widths = c(6, 6),
174+
sliderInput(
183175
inputId = ns("font_size"), label = "font size",
184176
min = 5L, max = 30L, value = 15L, step = 1L, ticks = FALSE
185-
)),
186-
column(6, sliderInput(
177+
),
178+
sliderInput(
187179
inputId = ns("label_rotation"), label = "rotate x labels",
188180
min = 0L, max = 90L, value = 45L, step = 1, ticks = FALSE
189-
))
181+
)
190182
)
191183
),
192184
tags$br(),
@@ -392,19 +384,14 @@ srv_variable_browser <- function(id,
392384
varname <- plot_var$variable[[dataname]]
393385
df <- data()[[dataname]]
394386

395-
numeric_ui <- tagList(fluidRow(
396-
tags$div(
397-
class = "col-md-4",
398-
shinyWidgets::switchInput(
399-
inputId = session$ns("remove_NA_hist"),
400-
label = "Remove NA values",
401-
value = FALSE,
402-
width = "50%",
403-
labelWidth = "100px",
404-
handleWidth = "50px"
405-
)
406-
)
407-
))
387+
numeric_ui <- shinyWidgets::switchInput(
388+
inputId = session$ns("remove_NA_hist"),
389+
label = "Remove NA values",
390+
value = FALSE,
391+
width = "50%",
392+
labelWidth = "100px",
393+
handleWidth = "50px"
394+
)
408395

409396
var <- df[[varname]]
410397
if (anyNA(var) && (is.factor(var) || is.character(var) || is.logical(var))) {

0 commit comments

Comments
 (0)