Skip to content

Commit c62e0bb

Browse files
committed
Merge branch 'report_redesign_poc@main' of https://github.com/insightsengineering/teal.modules.general into report_redesign_poc@main
2 parents e804ca5 + 71feb58 commit c62e0bb

23 files changed

+198
-204
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
@@ -333,8 +333,9 @@ ui_a_regression <- function(id, ...) {
333333
)
334334
),
335335
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
336-
teal.widgets::panel_group(
337-
teal.widgets::panel_item(
336+
bslib::accordion(
337+
open = TRUE,
338+
bslib::accordion_panel(
338339
title = "Plot settings",
339340
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Opacity:", args$alpha, ticks = FALSE),
340341
teal.widgets::optionalSliderInputValMinMax(ns("size"), "Points size:", args$size, ticks = FALSE),

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_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: 14 additions & 5 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(
@@ -433,8 +441,9 @@ ui_g_bivariate <- function(id, ...) {
433441
)
434442
)
435443
},
436-
teal.widgets::panel_group(
437-
teal.widgets::panel_item(
444+
bslib::accordion(
445+
open = TRUE,
446+
bslib::accordion_panel(
438447
title = "Plot settings",
439448
checkboxInput(ns("rotate_xaxis_labels"), "Rotate X axis labels", value = args$rotate_xaxis_labels),
440449
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:",

0 commit comments

Comments
 (0)