Skip to content

Commit

Permalink
update for cosistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Chlebowski committed Mar 18, 2024
1 parent 366a14c commit abd7d71
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion R/assaySpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ assaySpecServer <- function(id, # nolint
assert_character(exclude_assays, any.missing = FALSE)

moduleServer(id, function(input, output, session) {
ns <- session$ns

# When the assay names change, update the choices for assay.
choices <- reactive({
assays <- assays()
Expand All @@ -131,7 +133,7 @@ assaySpecServer <- function(id, # nolint
updateSelectizeInput(session, "name", choices = choices)
session$sendCustomMessage(
"toggle_dropdown",
list(input_id = session$ns("name"), disabled = (length(choices) == 0))
list(input_id = ns("name"), disabled = (length(choices) == 0))
)
})

Expand Down
4 changes: 3 additions & 1 deletion R/barplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ srv_g_barplot <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(shiny::isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment <- experimentSpecServer(
"experiment",
Expand Down
4 changes: 3 additions & 1 deletion R/boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ srv_g_boxplot <- function(id,
checkmate::assert_class(shiny::isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment <- experimentSpecServer(
"experiment",
Expand Down
4 changes: 3 additions & 1 deletion R/forestplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ srv_g_forest_tte <- function(id,
checkmate::assert_class(shiny::isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment <- experimentSpecServer(
"experiment",
Expand Down
6 changes: 4 additions & 2 deletions R/geneSpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ geneSpecServer <- function(id, # nolint
assert_character(label_modal_footer)

moduleServer(id, function(input, output, session) {
ns <- session$ns

# The `reactiveValues` object for storing current gene text input.
# This will also be a data frame with id and name columns.
parsed_genes <- reactiveVal(NULL, label = "Parsed genes")
Expand Down Expand Up @@ -380,14 +382,14 @@ geneSpecServer <- function(id, # nolint
dataModal <- function(example_list) { # nolint
modalDialog(
textInput(
session$ns("gene_text"),
ns("gene_text"),
label = label_modal_title,
placeholder = example_list
),
do.call("span", as.list(label_modal_footer)),
footer = tagList(
modalButton("Cancel"),
actionButton(session$ns("ok_button"), "OK")
actionButton(ns("ok_button"), "OK")
)
)
}
Expand Down
4 changes: 3 additions & 1 deletion R/km.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ srv_g_km <- function(id,
checkmate::assert_class(shiny::isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment <- experimentSpecServer(
"experiment",
Expand Down
4 changes: 3 additions & 1 deletion R/scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ srv_g_scatterplot <- function(id,
checkmate::assert_class(shiny::isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment <- experimentSpecServer(
"experiment",
Expand Down
4 changes: 3 additions & 1 deletion R/volcanoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ srv_g_volcanoplot <- function(id,
checkmate::assert_class(shiny::isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {
ns <- session$ns

output$experiment_ui <- renderUI({
experimentSpecInput(session$ns("experiment"), data, mae_name)
experimentSpecInput(ns("experiment"), data, mae_name)
})
experiment_data <- experimentSpecServer(
"experiment",
Expand Down

0 comments on commit abd7d71

Please sign in to comment.