Skip to content

Commit

Permalink
clean up panels and only render once plot created so no large blank s…
Browse files Browse the repository at this point in the history
…pace now
  • Loading branch information
aylapear committed Sep 4, 2023
1 parent 7b55787 commit 151de0c
Showing 1 changed file with 31 additions and 37 deletions.
68 changes: 31 additions & 37 deletions R/mod-results.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,24 @@ mod_results_ui <- function(id, label = "model") {
tabsetPanel(
tabPanel(
title = "1. Plot",
wellPanel(
br(),
uiOutput(ns("download_button_p1")),
br(), br(),
uiOutput(ns("ui_plot_1"))
)
br(),
uiOutput(ns("download_button_p1")),
br(), br(),
uiOutput(ns("ui_plot_1"))
),
tabPanel(
title = "2. Plot",
wellPanel(
br(),
uiOutput(ns("download_button_p2")),
br(), br(),
uiOutput(ns("ui_plot_2"))
)
br(),
uiOutput(ns("download_button_p2")),
br(), br(),
uiOutput(ns("ui_plot_2"))
),
tabPanel(
title = "3. Plot",
wellPanel(
br(),
uiOutput(ns("download_button_p3")),
br(), br(),
uiOutput(ns("ui_plot_3"))
)
br(),
uiOutput(ns("download_button_p3")),
br(), br(),
uiOutput(ns("ui_plot_3"))
)
)
)
Expand All @@ -55,30 +49,24 @@ mod_results_ui <- function(id, label = "model") {
tabsetPanel(
tabPanel(
title = "1. Table",
wellPanel(
br(),
uiOutput(ns("download_button_t1")),
br(), br(),
uiOutput(ns("ui_table_1"))
)
br(),
uiOutput(ns("download_button_t1")),
br(), br(),
uiOutput(ns("ui_table_1"))
),
tabPanel(
title = "2. Table",
wellPanel(
br(),
uiOutput(ns("download_button_t2")),
br(), br(),
uiOutput(ns("ui_table_2"))
)
title = "2. Table",
br(),
uiOutput(ns("download_button_t2")),
br(), br(),
uiOutput(ns("ui_table_2"))
),
tabPanel(
title = "3. Table",
wellPanel(
br(),
uiOutput(ns("download_button_t3")),
br(), br(),
uiOutput(ns("ui_table_3"))
)
br(),
uiOutput(ns("download_button_t3")),
br(), br(),
uiOutput(ns("ui_table_3"))
)
)
)
Expand Down Expand Up @@ -120,6 +108,7 @@ mod_results_server <- function(id, data, model) {
})

output$ui_plot_1 <- renderUI({
req(rv$data1)
plotOutput(ns("plot_1"))
})

Expand Down Expand Up @@ -149,6 +138,7 @@ mod_results_server <- function(id, data, model) {
})

output$ui_plot_2 <- renderUI({
req(rv$data1)
plotOutput(ns("plot_2"))
})

Expand Down Expand Up @@ -177,6 +167,7 @@ mod_results_server <- function(id, data, model) {
})

output$ui_plot_3 <- renderUI({
req(rv$data1)
plotOutput(ns("plot_3"))
})

Expand All @@ -203,6 +194,7 @@ mod_results_server <- function(id, data, model) {
output$table_1 <- DT::renderDT(data_table(rv$data1))

output$ui_table_1 <- renderUI({
req(rv$data1)
DT::DTOutput(ns("table_1"))
})

Expand All @@ -221,6 +213,7 @@ mod_results_server <- function(id, data, model) {
output$table_2 <- DT::renderDT(data_table(rv$data2))

output$ui_table_2 <- renderUI({
req(rv$data2)
DT::DTOutput(ns("table_2"))
})

Expand All @@ -239,6 +232,7 @@ mod_results_server <- function(id, data, model) {
output$table_3 <- DT::renderDT(data_table(rv$data3))

output$ui_table_3 <- renderUI({
req(rv$data3)
DT::DTOutput(ns("table_3"))
})

Expand Down

0 comments on commit 151de0c

Please sign in to comment.