1- pkgload :: load_all(" teal" )
2- pkgload :: load_all(" teal.widgets" )
1+ library(plotly )
32pkgload :: load_all(" teal.modules.general" )
43
54# Example data
@@ -10,7 +9,8 @@ data <- within(teal_data(), {
109 EOTSTT2 = case_when(
1110 ! is.na(DCSREAS ) ~ DCSREAS ,
1211 TRUE ~ EOTSTT
13- )
12+ ),
13+ TRTLEN = as.integer(TRTEDTM - TRTSDTM )
1414 )
1515
1616 ADAE <- teal.data :: rADAE
@@ -21,21 +21,22 @@ join_keys(data) <- default_cdisc_join_keys
2121
2222
2323plotly_specs <- list (
24- list (" plotly::add_bars" , x = ~ EOSDY , y = ~ USUBJID , data = quote(ADSL )),
25- list (" plotly::add_markers" , x = ~ EOSDY , y = ~ USUBJID , color = ~ EOTSTT2 , data = quote(ADSL )),
26- list (" plotly::add_markers" , x = ~ ADY , y = ~ USUBJID , data = quote(ADRS ))
24+ list (" plotly::add_bars" , x = ~ TRTLEN , y = ~ USUBJID , color = ~ ARM , data = quote(ADSL )),
25+ list (" plotly::add_markers" , x = ~ ADY , y = ~ USUBJID , color = ~ AVALC , symbol = ~ AVALC , data = quote(ADRS ))
2726)
2827
29-
3028app <- init(
3129 data = data ,
3230 modules = modules(
3331 tm_data_table(),
34- tm_p_swimlane2 (
32+ tm_p_plotly (
3533 label = " Swimlane" ,
3634 plotly_specs = plotly_specs ,
3735 title = " Swimlane Efficacy Plot"
3836 )
37+ ),
38+ filter = teal_slices(
39+ teal_slice(" ADSL" , " AGE" , selected = c(20 , 25 ))
3940 )
4041)
4142
0 commit comments