Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 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
11 changes: 8 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ Depends:
ggplot2 (>= 3.4.0),
R (>= 4.1),
shiny (>= 1.6.0),
teal (>= 0.16.0),
teal (>= 0.16.0.9002),
teal.transform (>= 0.6.0)
Imports:
bslib (>= 0.8.0),
checkmate (>= 2.1.0),
colourpicker (>= 1.3.0),
dplyr (>= 1.0.5),
Expand Down Expand Up @@ -60,8 +61,8 @@ Imports:
teal.code (>= 0.6.1),
teal.data (>= 0.7.0),
teal.logger (>= 0.3.2),
teal.reporter (>= 0.4.0),
teal.widgets (>= 0.4.3),
teal.reporter (>= 0.4.0.9004),
teal.widgets (>= 0.4.3.9001),
tern (>= 0.9.7),
tibble (>= 2.0.0),
tidyr (>= 0.8.3),
Expand Down Expand Up @@ -105,3 +106,7 @@ Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE, packages = c("roxy.shinylive"))
RoxygenNote: 7.3.2
Remotes:
insightsengineering/teal.widgets@main,
insightsengineering/teal.reporter@main,
insightsengineering/teal@main
13 changes: 6 additions & 7 deletions R/tm_a_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ ui_a_pca <- function(id, ...) {
data_extract_spec = args$dat,
is_single_dataset = is_single_dataset_value
),
teal.widgets::panel_group(
teal.widgets::panel_item(
bslib::accordion(
open = TRUE,
bslib::accordion_panel(
title = "Display",
collapsed = FALSE,
checkboxGroupInput(
ns("tables_display"),
"Tables display",
Expand Down Expand Up @@ -291,7 +291,7 @@ ui_a_pca <- function(id, ...) {
)
)
),
teal.widgets::panel_item(
bslib::accordion_panel(
title = "Pre-processing",
radioButtons(
ns("standardization"), "Standardization",
Expand All @@ -304,9 +304,8 @@ ui_a_pca <- function(id, ...) {
selected = "none"
)
),
teal.widgets::panel_item(
bslib::accordion_panel(
title = "Selected plot specific settings",
collapsed = FALSE,
uiOutput(ns("plot_settings")),
conditionalPanel(
condition = sprintf("input['%s'] == 'Biplot'", ns("plot_type")),
Expand All @@ -322,7 +321,7 @@ ui_a_pca <- function(id, ...) {
)
)
),
teal.widgets::panel_item(
bslib::accordion_panel(
title = "Plot settings",
collapsed = TRUE,
conditionalPanel(
Expand Down
29 changes: 14 additions & 15 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ ui_a_regression <- function(id, ...) {
### Reporter
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
###
tags$label("Encodings", class = "text-primary"),
tags$label("Encodings", class = "text-primary"), tags$br(),
teal.transform::datanames_input(args[c("response", "regressor")]),
teal.transform::data_extract_ui(
id = ns("response"),
Expand All @@ -315,12 +315,10 @@ ui_a_regression <- function(id, ...) {
teal.widgets::optionalSliderInput(
ns("outlier"),
tags$div(
class = "teal-tooltip",
tagList(
"Outlier definition:",
icon("circle-info"),
tags$span(
class = "tooltiptext",
bslib::tooltip(
icon("fas fa-circle-info"),
paste(
"Use the slider to choose the cut-off value to define outliers.",
"Points with a Cook's distance greater than",
Expand All @@ -338,24 +336,25 @@ ui_a_regression <- function(id, ...) {
)
),
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
teal.widgets::panel_group(
teal.widgets::panel_item(
bslib::accordion(
open = TRUE,
bslib::accordion_panel(
title = "Plot settings",
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Opacity:", args$alpha, ticks = FALSE),
teal.widgets::optionalSliderInputValMinMax(ns("size"), "Points size:", args$size, ticks = FALSE),
teal.widgets::optionalSliderInputValMinMax(
inputId = ns("label_min_segment"),
label = tags$div(
class = "teal-tooltip",
tagList(
"Label min. segment:",
icon("circle-info"),
tags$span(
class = "tooltiptext",
paste(
"Use the slider to choose the cut-off value to define minimum distance between label and point",
"that generates a line segment.",
"It's only valid when 'Display outlier labels' is checked."
bslib::tooltip(
icon("circle-info"),
tags$span(
paste(
"Use the slider to choose the cut-off value to define minimum distance between label and point",
"that generates a line segment.",
"It's only valid when 'Display outlier labels' is checked."
)
)
)
)
Expand Down
40 changes: 15 additions & 25 deletions R/tm_data_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,15 @@ ui_page_data_table <- function(id, pre_output = NULL, post_output = NULL) {
include_css_files("custom"),
teal.widgets::standard_layout(
output = teal.widgets::white_small_well(
fluidRow(
column(
width = 12,
checkboxInput(
ns("if_distinct"),
"Show only distinct rows:",
value = FALSE
)
bslib::page_fluid(
checkboxInput(
ns("if_distinct"),
"Show only distinct rows:",
value = FALSE
)
),
fluidRow(
class = "mb-8",
column(
width = 12,
uiOutput(ns("dataset_table"))
)
bslib::page_fluid(
uiOutput(ns("dataset_table"))
)
),
pre_output = pre_output,
Expand Down Expand Up @@ -233,15 +226,12 @@ srv_page_data_table <- function(id,
}
tabPanel(
title = x,
column(
width = 12,
div(
class = "mt-4",
ui_data_table(
id = session$ns(x),
choices = choices,
selected = variables_selected
)
bslib::layout_columns(
col_widths = 12,
ui_data_table(
id = session$ns(x),
choices = choices,
selected = variables_selected
)
)
)
Expand Down Expand Up @@ -281,7 +271,7 @@ ui_data_table <- function(id, choices, selected) {

tagList(
teal.widgets::get_dt_rows(ns("data_table"), ns("dt_rows")),
fluidRow(
bslib::page_fluid(
teal.widgets::optionalSelectInput(
ns("variables"),
"Select variables:",
Expand All @@ -291,7 +281,7 @@ ui_data_table <- function(id, choices, selected) {
width = "100%"
)
),
fluidRow(
bslib::page_fluid(
DT::dataTableOutput(ns("data_table"), width = "100%")
)
)
Expand Down
5 changes: 3 additions & 2 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ ui_tm_g_association <- function(id, ...) {
value = FALSE
),
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
teal.widgets::panel_group(
teal.widgets::panel_item(
bslib::accordion(
open = TRUE,
bslib::accordion_panel(
title = "Plot settings",
teal.widgets::optionalSliderInputValMinMax(ns("alpha"), "Scatterplot opacity:", c(0.5, 0, 1), ticks = FALSE),
teal.widgets::optionalSliderInputValMinMax(ns("size"), "Scatterplot points size:", c(2, 1, 8), ticks = FALSE),
Expand Down
19 changes: 14 additions & 5 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,12 @@ ui_g_bivariate <- function(id, ...) {
if (!is.null(args$row_facet) || !is.null(args$col_facet)) {
tags$div(
class = "data-extract-box",
tags$label("Facetting"),
shinyWidgets::switchInput(inputId = ns("facetting"), value = args$facet, size = "mini"),
tags$br(),
bslib::input_switch(
id = ns("facetting"),
label = "Facetting",
value = args$facet
),
conditionalPanel(
condition = paste0("input['", ns("facetting"), "']"),
tags$div(
Expand Down Expand Up @@ -404,7 +408,11 @@ ui_g_bivariate <- function(id, ...) {
tags$div(
class = "data-extract-box",
tags$label("Color settings"),
shinyWidgets::switchInput(inputId = ns("coloring"), value = TRUE, size = "mini"),
bslib::input_switch(
id = ns("coloring"),
label = "Color settings",
value = TRUE
),
conditionalPanel(
condition = paste0("input['", ns("coloring"), "']"),
tags$div(
Expand Down Expand Up @@ -433,8 +441,9 @@ ui_g_bivariate <- function(id, ...) {
)
)
},
teal.widgets::panel_group(
teal.widgets::panel_item(
bslib::accordion(
open = TRUE,
bslib::accordion_panel(
title = "Plot settings",
checkboxInput(ns("rotate_xaxis_labels"), "Rotate X axis labels", value = args$rotate_xaxis_labels),
checkboxInput(ns("swap_axes"), "Swap axes", value = args$swap_axes),
Expand Down
87 changes: 43 additions & 44 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ ui_distribution <- function(id, ...) {
is_single_dataset = is_single_dataset_value
)
},
teal.widgets::panel_group(
bslib::accordion(
conditionalPanel(
condition = paste0("input['", ns("tabs"), "'] == 'Histogram'"),
teal.widgets::panel_item(
bslib::accordion_panel(
"Histogram",
teal.widgets::optionalSliderInputValMinMax(ns("bins"), "Bins", args$bins, ticks = FALSE, step = 1),
shinyWidgets::prettyRadioButtons(
Expand All @@ -306,13 +306,12 @@ ui_distribution <- function(id, ...) {
ui_decorate_teal_data(
ns("d_density"),
decorators = select_decorators(args$decorators, "histogram_plot")
),
collapsed = FALSE
)
)
),
conditionalPanel(
condition = paste0("input['", ns("tabs"), "'] == 'QQplot'"),
teal.widgets::panel_item(
bslib::accordion_panel(
"QQ Plot",
checkboxInput(ns("qq_line"), label = "Add diagonal line(s)", TRUE),
ui_decorate_teal_data(
Expand All @@ -332,18 +331,18 @@ ui_distribution <- function(id, ...) {
),
conditionalPanel(
condition = paste0("input['", ns("main_type"), "'] == 'Density'"),
teal.widgets::panel_item(
bslib::accordion_panel(
"Theoretical Distribution",
teal.widgets::optionalSelectInput(
ns("t_dist"),
tags$div(
class = "teal-tooltip",
tagList(
"Distribution:",
icon("circle-info"),
tags$span(
class = "tooltiptext",
"Default parameters are optimized with MASS::fitdistr function."
bslib::tooltip(
icon("circle-info"),
tags$span(
"Default parameters are optimized with MASS::fitdistr function."
)
)
)
),
Expand All @@ -356,39 +355,39 @@ ui_distribution <- function(id, ...) {
tags$span(actionButton(ns("params_reset"), "Default params")),
collapsed = FALSE
)
)
),
teal.widgets::panel_item(
"Tests",
teal.widgets::optionalSelectInput(
ns("dist_tests"),
"Tests:",
choices = c(
"Shapiro-Wilk",
if (!is.null(args$strata_var)) "t-test (two-samples, not paired)",
if (!is.null(args$strata_var)) "one-way ANOVA",
if (!is.null(args$strata_var)) "Fligner-Killeen",
if (!is.null(args$strata_var)) "F-test",
"Kolmogorov-Smirnov (one-sample)",
"Anderson-Darling (one-sample)",
"Cramer-von Mises (one-sample)",
if (!is.null(args$strata_var)) "Kolmogorov-Smirnov (two-samples)"
),
selected = NULL
)
),
teal.widgets::panel_item(
"Statistics Table",
sliderInput(ns("roundn"), "Round to n digits", min = 0, max = 10, value = 2)
),
teal.widgets::panel_item(
title = "Plot settings",
selectInput(
inputId = ns("ggtheme"),
label = "Theme (by ggplot):",
choices = ggplot_themes,
selected = args$ggtheme,
multiple = FALSE
),
bslib::accordion_panel(
title = "Tests",
teal.widgets::optionalSelectInput(
ns("dist_tests"),
"Tests:",
choices = c(
"Shapiro-Wilk",
if (!is.null(args$strata_var)) "t-test (two-samples, not paired)",
if (!is.null(args$strata_var)) "one-way ANOVA",
if (!is.null(args$strata_var)) "Fligner-Killeen",
if (!is.null(args$strata_var)) "F-test",
"Kolmogorov-Smirnov (one-sample)",
"Anderson-Darling (one-sample)",
"Cramer-von Mises (one-sample)",
if (!is.null(args$strata_var)) "Kolmogorov-Smirnov (two-samples)"
),
selected = NULL
)
),
bslib::accordion_panel(
title = "Statistics Table",
sliderInput(ns("roundn"), "Round to n digits", min = 0, max = 10, value = 2)
),
bslib::accordion_panel(
title = "Plot settings",
selectInput(
inputId = ns("ggtheme"),
label = "Theme (by ggplot):",
choices = ggplot_themes,
selected = args$ggtheme,
multiple = FALSE
)
)
)
),
Expand Down
5 changes: 3 additions & 2 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ ui_g_response <- function(id, ...) {
justified = TRUE
),
ui_decorate_teal_data(ns("decorator"), decorators = select_decorators(args$decorators, "plot")),
teal.widgets::panel_group(
teal.widgets::panel_item(
bslib::accordion(
open = TRUE,
bslib::accordion_panel(
title = "Plot settings",
checkboxInput(ns("count_labels"), "Add count labels", value = args$count_labels),
checkboxInput(ns("coord_flip"), "Swap axes", value = args$coord_flip),
Expand Down
Loading
Loading