You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass decorators, simultenously, where one is named and other is not (then applied to all objects), then the UI gets multiplied.
In below example there are only 2 objects in the module (plot and table), and even though one decorator is not named, then this should create 3 decorators UI (2 decorators UI from unnamed decorator, 1 decorator UI from the named decorator). But has 4
Code
pkgload::load_all(".", export_all=FALSE)
caption_decorator<-function(default_caption="I am a good decorator", .var_to_replace="plot") {
teal_transform_module(
label="Caption",
ui=function(id) shiny::textInput(shiny::NS(id, "footnote"), "Footnote", value=default_caption),
server= make_teal_transform_server(
substitute({
.var_to_replace<-.var_to_replace+ggplot2::labs(caption=footnote)
}, env=list(.var_to_replace= as.name(.var_to_replace)))
)
)
}
library(dplyr)
data<- within(teal_data(), {
ADSL<-tmc_ex_adsl|>
mutate(ITTFL=factor("Y") |> with_label("Intent-To-Treat Population Flag")) |>
mutate(DTHFL= case_when(!is.na(DTHDT) ~"Y", TRUE~"") |> with_label("Subject Death Flag"))
ADAE<-tmc_ex_adae|>
filter(!((AETOXGR==1) & (AESEV=="MILD") & (ARM=="A: Drug X")))
ADAE$ASTDY<- structure(
as.double(ADAE$ASTDY, unit= attr(ADAE$ASTDY, "units", exact=TRUE)),
label= attr(ADAE$ASTDY, "label", exact=TRUE)
)
.lbls_adae<- col_labels(tmc_ex_adae)
ADAE<-tmc_ex_adae %>%
mutate_if(is.character, as.factor) #' be certain of having factors
col_labels(ADAE) <-.lbls_adae# summaryADSL$EOSDY[1] <-NA_integer_
})
join_keys(data) <-default_cdisc_join_keys[names(data)]
ADSL<-data[["ADSL"]]
ADAE<-data[["ADAE"]]
init(
data=data,
modules=
tm_g_pp_adverse_events(
label="Adverse Events",
dataname="ADAE",
parentname="ADSL",
patient_col="USUBJID",
plot_height= c(600L, 200L, 2000L),
aeterm= choices_selected(
choices= variable_choices(ADAE, "AETERM"),
selected="AETERM"
),
tox_grade= choices_selected(
choices= variable_choices(ADAE, "AETOXGR"),
selected="AETOXGR"
),
causality= choices_selected(
choices= variable_choices(ADAE, "AEREL"),
selected="AEREL"
),
outcome= choices_selected(
choices= variable_choices(ADAE, "AEOUT"),
selected="AEOUT"
),
action= choices_selected(
choices= variable_choices(ADAE, "AEACN"),
selected="AEACN"
),
time= choices_selected(
choices= variable_choices(ADAE, "ASTDY"),
selected="ASTDY"
),
decod=NULL,
decorators=list(
caption_decorator('I am a good caption', 'plot'),
plot= caption_decorator('I am a good caption', 'plot')
)
),
) |>shiny::runApp()
The text was updated successfully, but these errors were encountered:
If you pass decorators, simultenously, where one is named and other is not (then applied to all objects), then the UI gets multiplied.
In below example there are only 2 objects in the module (plot and table), and even though one decorator is not named, then this should create 3 decorators UI (2 decorators UI from unnamed decorator, 1 decorator UI from the named decorator). But has 4
Code
The text was updated successfully, but these errors were encountered: