Skip to content

Commit

Permalink
refac: extract function for cluster-stats UI
Browse files Browse the repository at this point in the history
  • Loading branch information
russHyde committed Mar 14, 2024
1 parent d4f2232 commit afe25e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
28 changes: 1 addition & 27 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,7 @@ app_ui = function(request) {
shiny::tabPanel(
title = "Data",
shiny::fluidRow(
shiny::column(
12,
# use details and summary to create expandable section
htmltools::tags$details(
# preview of expandable section
htmltools::tags$summary("Cluster statistics (click to expand)"),
shiny::br(),

# text to print choice
shiny::textOutput("select_text"),
shiny::br(),

# output options
shiny::tabsetPanel(
id = "plot_tabs",

# Tables tab
tablesUI("table1"),

# Plots tab
plotsUI("plot1"),

# RDS tab
rdsUI("rds1")
)
)
)
shiny::column(12, clusterStatsUI(id = NULL))
), # end fluid row

# Bottom row - show tree (static html output from tfpscanner)
Expand Down
28 changes: 28 additions & 0 deletions R/module_cluster_stats.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
clusterStatsUI = function(id) {
ns = NS(id)

# use details and summary to create expandable section
htmltools::tags$details(
# preview of expandable section
htmltools::tags$summary("Cluster statistics (click to expand)"),
shiny::br(),

# text to print choice
shiny::textOutput(ns("select_text")),
shiny::br(),

# output options
shiny::tabsetPanel(
id = ns("plot_tabs"),

# Tables tab
tablesUI(ns("table1")),

# Plots tab
plotsUI(ns("plot1")),

# RDS tab
rdsUI(ns("rds1"))
)
)
}

0 comments on commit afe25e4

Please sign in to comment.