Skip to content
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
74e72d8
set Remotes
m7pr Jul 7, 2025
b0063a9
remove unneeded reporter code
m7pr Jul 7, 2025
f6cf348
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 7, 2025
e7d0f45
add inheritsection
m7pr Jul 7, 2025
707e2bf
add teal_cards
m7pr Jul 7, 2025
1e9b712
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 7, 2025
d9fb7dd
Merge branch 'main' into teal_reportable
m7pr Jul 10, 2025
7c6f94a
final cleanup
m7pr Jul 10, 2025
c9eb0f6
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr Jul 10, 2025
90271fb
add Descriptive Statistics section
m7pr Jul 10, 2025
d8613e3
Update R/tm_g_gh_spaghettiplot.R
m7pr Jul 10, 2025
649a7b1
Update R/tm_g_gh_correlationplot.R
m7pr Jul 10, 2025
0720f14
Update R/tm_g_gh_lineplot.R
m7pr Jul 10, 2025
697c9cf
Update R/tm_g_gh_scatterplot.R
m7pr Jul 10, 2025
f74c86e
build teal_report on top of the previous one, so we dont duplicate te…
m7pr Jul 10, 2025
3d435bd
substitute append.teal_card with c.teal_card
m7pr Jul 10, 2025
6bf7413
[skip style] [skip vbump] Restyle files
github-actions[bot] Jul 10, 2025
11a67a2
Merge branch 'main' into teal_reportable
m7pr Jul 11, 2025
109c80d
Merge branch 'main' into teal_reportable
m7pr Sep 4, 2025
ce72477
remove whitespaces from code
m7pr Sep 4, 2025
7b89791
Update DESCRIPTION
averissimo Sep 4, 2025
f0799c9
update teal and teal.reporter
m7pr Sep 4, 2025
2119ddc
main is default branch
m7pr Sep 4, 2025
4a28f5c
set_dims for plots
m7pr Sep 9, 2025
6eeb8d8
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 9, 2025
189c4e1
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Sep 9, 2025
e3c4ca8
old version of set_attrs
m7pr Sep 9, 2025
8eca03d
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr Sep 9, 2025
7a0f979
bring back constrains for boxplot
m7pr Sep 9, 2025
86d9d7d
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Sep 9, 2025
ed95681
fixes for tm_g_gh_density
m7pr Sep 11, 2025
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
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Depends:
goshawk (>= 0.1.19),
R (>= 3.6),
shiny (>= 1.8.1),
teal (>= 1.0.0),
teal (>= 1.0.0.9003),
teal.transform (>= 0.7.0)
Imports:
bslib (>= 0.8.0),
Expand All @@ -50,7 +50,7 @@ Imports:
stats,
teal.code (>= 0.7.0),
teal.logger (>= 0.4.0),
teal.reporter (>= 0.5.0),
teal.reporter (>= 0.5.0.9001),
teal.widgets (>= 0.5.0)
Suggests:
knitr (>= 1.42),
Expand All @@ -59,14 +59,16 @@ Suggests:
rvest (>= 1.0.0),
shinytest2 (>= 0.4.1),
stringr (>= 1.4.1),
teal.data (>= 0.7.0),
teal.data (>= 0.7.0.9002),
tern (>= 0.9.7),
testthat (>= 3.2.3),
utils
VignetteBuilder:
knitr,
rmarkdown
Remotes:
insightsengineering/teal,
insightsengineering/teal.reporter,
insightsengineering/goshawk
Config/Needs/verdepcheck: insightsengineering/goshawk, rstudio/shiny,
insightsengineering/teal, insightsengineering/teal.slice,
Expand All @@ -85,4 +87,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
72 changes: 27 additions & 45 deletions R/tm_g_gh_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#' @author Jeff Tomlinson (tomlinsj) [email protected]
#' @author Balazs Toth (tothb2) [email protected]
#'
#' @inheritSection teal::example_module Reporting
#'
#' @return an \code{\link[teal]{module}} object
#'
#' @export
Expand Down Expand Up @@ -240,10 +242,6 @@ ui_g_boxplot <- function(id, ...) {
)
),
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
templ_ui_dataname(a$dataname),
uiOutput(ns("axis_selections")),
templ_ui_constraint(ns, label = "Data Constraint"), # required by constr_anl_q
Expand Down Expand Up @@ -287,8 +285,6 @@ ui_g_boxplot <- function(id, ...) {

srv_g_boxplot <- function(id,
data,
reporter,
filter_panel_api,
dataname,
param_var,
trt_group,
Expand All @@ -299,8 +295,6 @@ srv_g_boxplot <- function(id,
hline_vars_colors,
hline_vars_labels,
module_args) {
with_reporter <- !missing(reporter) && inherits(reporter, "Reporter")
with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI")
checkmate::assert_class(data, "reactive")
checkmate::assert_class(shiny::isolate(data()), "teal_data")

Expand Down Expand Up @@ -383,7 +377,6 @@ srv_g_boxplot <- function(id,

create_plot <- debounce(reactive({
teal::validate_inputs(iv_r())

req(anl_q())
# nolint start
param <- input$xaxis_param
Expand Down Expand Up @@ -426,7 +419,30 @@ srv_g_boxplot <- function(id,
)
}

anl_q()$qenv %>% teal.code::eval_code(
obj <- anl_q()$qenv

constraint_description <- c(
paste("\nFacet By:", if (length(input$facet_var) != 0) input$facet_var else "None"),
paste("\nSelect an X-axis Variable:", input$xaxis_var)
)

teal.reporter::teal_card(obj) <-
c(
teal.reporter::teal_card("# Box Plot"),
teal.reporter::teal_card(obj),
teal.reporter::teal_card(
"## Selected Options",
formatted_data_constraint(
constraint_var = input$xaxis_param,
constraint_range_min = input$constraint_range_min,
constraint_range_max = input$constraint_range_max
),
constraint_description
),
teal.reporter::teal_card("## Plot")
)

obj %>% teal.code::eval_code(
code = bquote({
p <- goshawk::g_boxplot(
data = ANL,
Expand Down Expand Up @@ -512,41 +528,6 @@ srv_g_boxplot <- function(id,

code <- reactive(teal.code::get_code(joined_qenvs()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
constraint_description <- paste(
"\nFacet By:",
if (length(input$facet_var) != 0) input$facet_var else "None",
"\nSelect an X-axis Variable:",
input$xaxis_var
)
card <- report_card_template_goshawk(
title = "Box Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api,
constraint_list = list(
constraint_var = input$constraint_var,
constraint_range_min = input$constraint_range_min,
constraint_range_max = input$constraint_range_max
),
constraint_description = constraint_description,
style = "verbatim"
)
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = boxplot_data$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(code())
card
}
teal.reporter::add_card_button_srv("add_reporter", reporter = reporter, card_fun = card_fun)
}
###

# highlight plot area
reactive_df <- debounce(reactive({
boxplot_brush <- boxplot_data$brush()
Expand Down Expand Up @@ -584,5 +565,6 @@ srv_g_boxplot <- function(id,
verbatim_content = reactive(code()),
title = "Show R Code for Boxplot"
)
set_chunk_dims(boxplot_data, create_plot)
})
}
57 changes: 13 additions & 44 deletions R/tm_g_gh_correlationplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
#' @author Nick Paszty (npaszty) [email protected]
#' @author Balazs Toth (tothb2) [email protected]
#'
#' @inheritSection teal::example_module Reporting
#'
#'
#' @examples
#' # Example using ADaM structure analysis dataset.
#' data <- teal_data()
Expand Down Expand Up @@ -278,10 +281,6 @@ ui_g_correlationplot <- function(id, ...) {
teal.widgets::standard_layout(
output = templ_ui_output_datatable(ns),
encoding = tags$div(
### Reporter
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
tags$br(), tags$br(),
###
templ_ui_dataname(a$dataname),
uiOutput(ns("axis_selections")),
templ_ui_constraint(ns, "X-Axis Data Constraint"), # required by constr_anl_q
Expand Down Expand Up @@ -352,8 +351,6 @@ ui_g_correlationplot <- function(id, ...) {

srv_g_correlationplot <- function(id,
data,
reporter,
filter_panel_api,
dataname,
param_var,
trt_group,
Expand All @@ -367,8 +364,6 @@ srv_g_correlationplot <- function(id,
vline_vars_colors,
vline_vars_labels,
module_args) {
with_reporter <- !missing(reporter) && inherits(reporter, "Reporter")
with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI")
checkmate::assert_class(data, "reactive")
checkmate::assert_class(shiny::isolate(data()), "teal_data")

Expand Down Expand Up @@ -775,8 +770,16 @@ srv_g_correlationplot <- function(id,
validate(need(input$trt_group, "Please select a treatment variable"))
trt_group <- input$trt_group

obj <- plot_data_transpose()$qenv
teal.reporter::teal_card(obj) <-
c(
teal.reporter::teal_card("# Correlation Plot"),
teal.reporter::teal_card(obj),
teal.reporter::teal_card("## Plot")
)

teal.code::eval_code(
object = plot_data_transpose()$qenv,
object = obj,
code = bquote({
# re-establish treatment variable label
p <- goshawk::g_correlationplot(
Expand Down Expand Up @@ -836,41 +839,6 @@ srv_g_correlationplot <- function(id,

code <- reactive(teal.code::get_code(plot_q()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
constraint_description <- paste(
"\nTreatment Variable Faceting:",
input$trt_facet,
"\nRegression Line:",
input$reg_line
)
card <- report_card_template_goshawk(
title = "Correlation Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api,
constraint_list = list(
constraint_var = input$constraint_var,
constraint_range_min = input$constraint_range_min,
constraint_range_max = input$constraint_range_max
),
constraint_description = constraint_description,
style = "verbatim"
)
card$append_text("Plot", "header3")
card$append_plot(plot_r(), dim = plot_data$dim())
if (!comment == "") {
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(code())
card
}
teal.reporter::add_card_button_srv("add_reporter", reporter = reporter, card_fun = card_fun)
}
###

reactive_df <- debounce(reactive({
req(iv_r()$is_valid())
plot_brush <- plot_data$brush()
Expand Down Expand Up @@ -901,5 +869,6 @@ srv_g_correlationplot <- function(id,
verbatim_content = reactive(code()),
title = "Show R Code for Correlation Plot"
)
set_chunk_dims(plot_data, plot_q)
})
}
Loading
Loading