Skip to content

Commit

Permalink
edit: added all result modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleGrealis committed Jan 5, 2024
1 parent 3957cc3 commit 05322e2
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions app/main.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
box::use(
bslib[bs_theme, nav_item, nav_menu, nav_panel, nav_spacer, navset_card_tab,
page_fillable],
dplyr[across, mutate, where],
shiny[icon, mainPanel, moduleServer, NS, observeEvent, observe, reactiveVal,
sidebarLayout, sidebarPanel, tags, a, div, uiOutput, renderUI, req,
reactive, renderTable, tableOutput],
)

box::use(
app/logic/functions[format_numbers],
app/view/algo,
app/view/data,
app/view/data_info,
app/view/inputs,
app/view/footer,
app/view/matched_results,
app/view/unmatched_results
)

link_shiny <- tags$a(
Expand Down Expand Up @@ -46,16 +46,15 @@ ui <- function(id) {
navset_card_tab(
nav_panel(
"Matched Data",
tableOutput(ns("algo"))
# "matched results will go here"
matched_results$ui(ns("matched"))
),
nav_panel(
"Cases",
"this will be the unmatched Cases"
unmatched_results$ui(ns("cases"))
),
nav_panel(
"Controls",
"this will be the unmatched Controls"
unmatched_results$ui(ns("controls"))
)
)
), # nav_panel
Expand All @@ -80,20 +79,10 @@ server <- function(id) {
newFile <- data$server("data_file")
data_info$server("info", newFile)
inputs <- inputs$server("inputs", newFile)

# Get results from algo$server
results <- algo$server("algo", newFile, inputs)

output$algo <- renderTable({
# Use req to wait for results to be available
req(results())

if (is.null(results())) {
return(NULL)
}
results() |>
mutate(across(where(is.numeric), format_numbers))
})
matched_results$server("matched", results)
unmatched_results$server("cases", newFile, inputs, results, "cases")
unmatched_results$server("controls", newFile, inputs, results, "controls")
})
}

Expand Down

0 comments on commit 05322e2

Please sign in to comment.