Skip to content

Commit 2423239

Browse files
committed
fix: replace deprecated function calls with bslib calls
1 parent 439bbc8 commit 2423239

13 files changed

+99
-88
lines changed

R/tm_a_pca.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ ui_a_pca <- function(id, ...) {
246246
data_extract_spec = args$dat,
247247
is_single_dataset = is_single_dataset_value
248248
),
249-
teal.widgets::panel_group(
250-
teal.widgets::panel_item(
249+
bslib::accordion(
250+
open = TRUE,
251+
bslib::accordion_panel(
251252
title = "Display",
252-
collapsed = FALSE,
253253
checkboxGroupInput(
254254
ns("tables_display"),
255255
"Tables display",
@@ -291,7 +291,7 @@ ui_a_pca <- function(id, ...) {
291291
)
292292
)
293293
),
294-
teal.widgets::panel_item(
294+
bslib::accordion_panel(
295295
title = "Pre-processing",
296296
radioButtons(
297297
ns("standardization"), "Standardization",
@@ -304,9 +304,8 @@ ui_a_pca <- function(id, ...) {
304304
selected = "none"
305305
)
306306
),
307-
teal.widgets::panel_item(
307+
bslib::accordion_panel(
308308
title = "Selected plot specific settings",
309-
collapsed = FALSE,
310309
uiOutput(ns("plot_settings")),
311310
conditionalPanel(
312311
condition = sprintf("input['%s'] == 'Biplot'", ns("plot_type")),
@@ -322,7 +321,7 @@ ui_a_pca <- function(id, ...) {
322321
)
323322
)
324323
),
325-
teal.widgets::panel_item(
324+
bslib::accordion_panel(
326325
title = "Plot settings",
327326
collapsed = TRUE,
328327
conditionalPanel(

R/tm_a_regression.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,9 @@ ui_a_regression <- function(id, ...) {
336336
)
337337
),
338338
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
339-
teal.widgets::panel_group(
340-
teal.widgets::panel_item(
339+
bslib::accordion(
340+
open = TRUE,
341+
bslib::accordion_panel(
341342
title = "Plot settings",
342343
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Opacity:", args$alpha, ticks = FALSE),
343344
teal.widgets::optionalSliderInputValMinMax(ns("size"), "Points size:", args$size, ticks = FALSE),

R/tm_g_association.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ ui_tm_g_association <- function(id, ...) {
265265
value = FALSE
266266
),
267267
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
268-
teal.widgets::panel_group(
269-
teal.widgets::panel_item(
268+
bslib::accordion(
269+
open = TRUE,
270+
bslib::accordion_panel(
270271
title = "Plot settings",
271272
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Scatterplot opacity:", c(0.5, 0, 1), ticks = FALSE),
272273
teal.widgets::optionalSliderInputValMinMax(ns("size"), "Scatterplot points size:", c(2, 1, 8), ticks = FALSE),

R/tm_g_bivariate.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ ui_g_bivariate <- function(id, ...) {
441441
)
442442
)
443443
},
444-
teal.widgets::panel_group(
445-
teal.widgets::panel_item(
444+
bslib::accordion(
445+
open = TRUE,
446+
bslib::accordion_panel(
446447
title = "Plot settings",
447448
checkboxInput(ns("rotate_xaxis_labels"), "Rotate X axis labels", value = args$rotate_xaxis_labels),
448449
checkboxInput(ns("swap_axes"), "Swap axes", value = args$swap_axes),

R/tm_g_distribution.R

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ ui_distribution <- function(id, ...) {
288288
is_single_dataset = is_single_dataset_value
289289
)
290290
},
291-
teal.widgets::panel_group(
291+
bslib::accordion(
292292
conditionalPanel(
293293
condition = paste0("input['", ns("tabs"), "'] == 'Histogram'"),
294-
teal.widgets::panel_item(
294+
bslib::accordion_panel(
295295
"Histogram",
296296
teal.widgets::optionalSliderInputValMinMax(ns("bins"), "Bins", args$bins, ticks = FALSE, step = 1),
297297
shinyWidgets::prettyRadioButtons(
@@ -306,13 +306,12 @@ ui_distribution <- function(id, ...) {
306306
ui_decorate_teal_data(
307307
ns("d_density"),
308308
decorators = select_decorators(args$decorators, "histogram_plot")
309-
),
310-
collapsed = FALSE
309+
)
311310
)
312311
),
313312
conditionalPanel(
314313
condition = paste0("input['", ns("tabs"), "'] == 'QQplot'"),
315-
teal.widgets::panel_item(
314+
bslib::accordion_panel(
316315
"QQ Plot",
317316
checkboxInput(ns("qq_line"), label = "Add diagonal line(s)", TRUE),
318317
ui_decorate_teal_data(
@@ -332,7 +331,7 @@ ui_distribution <- function(id, ...) {
332331
),
333332
conditionalPanel(
334333
condition = paste0("input['", ns("main_type"), "'] == 'Density'"),
335-
teal.widgets::panel_item(
334+
bslib::accordion_panel(
336335
"Theoretical Distribution",
337336
teal.widgets::optionalSelectInput(
338337
ns("t_dist"),
@@ -356,39 +355,39 @@ ui_distribution <- function(id, ...) {
356355
tags$span(actionButton(ns("params_reset"), "Default params")),
357356
collapsed = FALSE
358357
)
359-
)
360-
),
361-
teal.widgets::panel_item(
362-
"Tests",
363-
teal.widgets::optionalSelectInput(
364-
ns("dist_tests"),
365-
"Tests:",
366-
choices = c(
367-
"Shapiro-Wilk",
368-
if (!is.null(args$strata_var)) "t-test (two-samples, not paired)",
369-
if (!is.null(args$strata_var)) "one-way ANOVA",
370-
if (!is.null(args$strata_var)) "Fligner-Killeen",
371-
if (!is.null(args$strata_var)) "F-test",
372-
"Kolmogorov-Smirnov (one-sample)",
373-
"Anderson-Darling (one-sample)",
374-
"Cramer-von Mises (one-sample)",
375-
if (!is.null(args$strata_var)) "Kolmogorov-Smirnov (two-samples)"
376-
),
377-
selected = NULL
378-
)
379-
),
380-
teal.widgets::panel_item(
381-
"Statistics Table",
382-
sliderInput(ns("roundn"), "Round to n digits", min = 0, max = 10, value = 2)
383-
),
384-
teal.widgets::panel_item(
385-
title = "Plot settings",
386-
selectInput(
387-
inputId = ns("ggtheme"),
388-
label = "Theme (by ggplot):",
389-
choices = ggplot_themes,
390-
selected = args$ggtheme,
391-
multiple = FALSE
358+
),
359+
bslib::accordion_panel(
360+
title = "Tests",
361+
teal.widgets::optionalSelectInput(
362+
ns("dist_tests"),
363+
"Tests:",
364+
choices = c(
365+
"Shapiro-Wilk",
366+
if (!is.null(args$strata_var)) "t-test (two-samples, not paired)",
367+
if (!is.null(args$strata_var)) "one-way ANOVA",
368+
if (!is.null(args$strata_var)) "Fligner-Killeen",
369+
if (!is.null(args$strata_var)) "F-test",
370+
"Kolmogorov-Smirnov (one-sample)",
371+
"Anderson-Darling (one-sample)",
372+
"Cramer-von Mises (one-sample)",
373+
if (!is.null(args$strata_var)) "Kolmogorov-Smirnov (two-samples)"
374+
),
375+
selected = NULL
376+
)
377+
),
378+
bslib::accordion_panel(
379+
title = "Statistics Table",
380+
sliderInput(ns("roundn"), "Round to n digits", min = 0, max = 10, value = 2)
381+
),
382+
bslib::accordion_panel(
383+
title = "Plot settings",
384+
selectInput(
385+
inputId = ns("ggtheme"),
386+
label = "Theme (by ggplot):",
387+
choices = ggplot_themes,
388+
selected = args$ggtheme,
389+
multiple = FALSE
390+
)
392391
)
393392
)
394393
),

R/tm_g_response.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ ui_g_response <- function(id, ...) {
304304
justified = TRUE
305305
),
306306
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
307-
teal.widgets::panel_group(
308-
teal.widgets::panel_item(
307+
bslib::accordion(
308+
open = TRUE,
309+
bslib::accordion_panel(
309310
title = "Plot settings",
310311
checkboxInput(ns("count_labels"), "Add count labels", value = args$count_labels),
311312
checkboxInput(ns("coord_flip"), "Swap axes", value = args$coord_flip),

R/tm_g_scatterplot.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ ui_g_scatterplot <- function(id, ...) {
441441
)
442442
},
443443
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
444-
teal.widgets::panel_group(
445-
teal.widgets::panel_item(
444+
bslib::accordion(
445+
open = TRUE,
446+
bslib::accordion_panel(
446447
title = "Plot settings",
447448
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Opacity:", args$alpha, ticks = FALSE),
448449
teal.widgets::optionalSelectInput(

R/tm_g_scatterplotmatrix.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ ui_g_scatterplotmatrix <- function(id, ...) {
264264
),
265265
tags$hr(),
266266
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
267-
teal.widgets::panel_group(
268-
teal.widgets::panel_item(
267+
bslib::accordion(
268+
open = TRUE,
269+
bslib::accordion_panel(
269270
title = "Plot settings",
270271
sliderInput(
271272
ns("alpha"), "Opacity:",

R/tm_missing_data.R

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,16 @@ encoding_missing_data <- function(id, summary_per_patient = FALSE, ggtheme, data
432432
),
433433
ui_decorate_teal_data(ns("dec_summary_table"), decorators = select_decorators(decorators, "table"))
434434
),
435-
teal.widgets::panel_item(
436-
title = "Plot settings",
437-
selectInput(
438-
inputId = ns("ggtheme"),
439-
label = "Theme (by ggplot):",
440-
choices = ggplot_themes,
441-
selected = ggtheme,
442-
multiple = FALSE
435+
bslib::accordion(
436+
bslib::accordion_panel(
437+
title = "Plot settings",
438+
selectInput(
439+
inputId = ns("ggtheme"),
440+
label = "Theme (by ggplot):",
441+
choices = ggplot_themes,
442+
selected = ggtheme,
443+
multiple = FALSE
444+
)
443445
)
444446
)
445447
)

R/tm_outliers.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ ui_outliers <- function(id, ...) {
292292
),
293293
shinyjs::hidden(checkboxInput(ns("split_outliers"), "Define outliers based on group splitting", value = FALSE)),
294294
shinyjs::hidden(checkboxInput(ns("order_by_outlier"), "Re-order categories by outliers [by %]", value = FALSE)),
295-
teal.widgets::panel_group(
296-
teal.widgets::panel_item(
295+
bslib::accordion(
296+
open = TRUE,
297+
bslib::accordion_panel(
297298
title = "Method parameters",
298299
collapsed = FALSE,
299300
teal.widgets::optionalSelectInput(
@@ -364,7 +365,7 @@ ui_outliers <- function(id, ...) {
364365
)
365366
),
366367
ui_decorate_teal_data(ns("d_table"), decorators = select_decorators(args$decorators, "table")),
367-
teal.widgets::panel_item(
368+
bslib::accordion_panel(
368369
title = "Plot settings",
369370
selectInput(
370371
inputId = ns("ggtheme"),

0 commit comments

Comments
 (0)