Skip to content

Commit

Permalink
Use the app modifiers in favor of init args (#185)
Browse files Browse the repository at this point in the history
Part of insightsengineering/teal#1310

---------

Signed-off-by: Vedha Viyash <[email protected]>
Co-authored-by: Marcin <[email protected]>
  • Loading branch information
vedhav and m7pr authored Jan 20, 2025
1 parent a94fd42 commit c4d8237
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 37 deletions.
11 changes: 7 additions & 4 deletions RNA-seq/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ footer <- tags$p(

app <- init(
data = data,
title = build_app_title("RNA-Seq Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
modules = modules(
tm_front_page(
label = "App Info",
Expand Down Expand Up @@ -84,7 +81,13 @@ app <- init(
mae_name = "MAE"
)
)
)
) |>
modify_title(
title = "RNA-Seq Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

## Not run:
shinyApp(app$ui, app$server)
13 changes: 8 additions & 5 deletions basic-teal/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ footer <- tags$p(
app <- init(
data = data,
filter = filters,
modules = modules(example_module()),
title = build_app_title("Basic Teal Demo App", nest_logo),
header = header,
footer = footer
)
modules = modules(example_module())
) |>
modify_title(
title = "Basic Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions early-dev/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ footer <- tags$p(
## Setup App
app <- init(
data = data,
title = build_app_title("Early Development Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
filter = teal_slices(
count_type = "all",
teal_slice(dataname = "ADSL", varname = "SAFFL", selected = "Y"),
Expand Down Expand Up @@ -435,7 +432,13 @@ app <- init(
plot_height = c(1200, 400, 5000)
)
)
)
) |>
modify_title(
title = "Early Development Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

## Start Teal Shiny App ----
shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions efficacy/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ footer <- tags$p(
## Setup App
app <- init(
data = data,
title = build_app_title("Efficacy Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
filter = teal_slices(
count_type = "all",
teal_slice(dataname = "ADSL", varname = "ITTFL", selected = "Y"),
Expand Down Expand Up @@ -299,6 +296,12 @@ app <- init(
paramcd = cs_paramcd_qs
)
)
)
) |>
modify_title(
title = "Efficacy Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions exploratory/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ footer <- tags$p(

app <- init(
data = data,
title = build_app_title("Exploratory Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
filter = teal_slices(
count_type = "all",
teal_slice(dataname = "ADSL", varname = "SEX"),
Expand Down Expand Up @@ -348,6 +345,12 @@ app <- init(
plot_width = c(600L, 200L, 2000L)
)
)
)
) |>
modify_title(
title = "Exploratory Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions longitudinal/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ footer <- tags$p(

app <- teal::init(
data = data,
title = build_app_title("Longitudinal Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
filter = teal_slices(
count_type = "all",
teal_slice(dataname = "ADSL", varname = "SEX"),
Expand Down Expand Up @@ -773,6 +770,12 @@ app <- teal::init(
)
)
)
)
) |>
modify_title(
title = "Longitudinal Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions patient-profile/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ footer <- tags$p(

app <- init(
data = data,
title = build_app_title("Patient Profile Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
filter = teal_slices(
count_type = "all",
teal_slice(dataname = "ADSL", varname = "SEX"),
Expand Down Expand Up @@ -310,6 +307,12 @@ app <- init(
),
)
)
)
) |>
modify_title(
title = "Patient Profile Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions python/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ footer <- tags$p(

app <- teal::init(
data = data,
title = build_app_title("Python Dataset Teal Demo App", nest_logo),
header = header,
footer = footer,
modules = modules(
tm_data_table("Data Table"),
tm_variable_browser("Variable Browser"),
Expand Down Expand Up @@ -155,6 +152,12 @@ app <- teal::init(
)
)
)
)
) |>
modify_title(
title = "Python Dataset Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)
11 changes: 7 additions & 4 deletions safety/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ footer <- tags$p(
## Setup App
app <- teal::init(
data = data,
title = build_app_title("Safety Analysis Teal Demo App", nest_logo),
header = header,
footer = footer,
# Set initial filter state as safety-evaluable population
filter = teal_slices(
count_type = "all",
Expand Down Expand Up @@ -494,6 +491,12 @@ app <- teal::init(
plot_height = c(1000L, 200L, 4000L)
)
)
)
) |>
modify_title(
title = "Safety Analysis Teal Demo App",
favicon = nest_logo
) |>
modify_header(header = header) |>
modify_footer(footer = footer)

shinyApp(app$ui, app$server)

0 comments on commit c4d8237

Please sign in to comment.