#' covid UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny tagList fluidRow column sliderInput plotOutput tags
mod_covid_ui <- function(id){
ns <- NS(id)
tagList(
fluidRow(
class = "covid-app",
# Sidebar:
column(2,
class = "app-sidebar",
# Wrapper for the back-to-menu button:
tags$div(
class = "btn-home-apps",
tags$i(class="fas fa-angle-left")
),
# Wrapper for the sidebar content:
tags$div(
class = "sidebar-content",
sliderInput(inputId = ns("obs"), "Number of observations:",
min = 0, max = 1000, value = 500
)
)
),
# Main content:
column(10,
class = "app-content",
plotOutput(ns("distPlot"))
)
)
)
}
#' covid Server Function
#'
#' @noRd
#' @importFrom shiny renderPlot
#' @importFrom graphics hist par
#' @importFrom stats rnorm
mod_covid_server <- function(input, output, session){
ns <- session$ns
output$distPlot <- renderPlot({
par(bg=NA)
hist(rnorm(input$obs))
})
}
## To be copied in the UI
# mod_covid_ui("covid_ui_1")
## To be copied in the server
# callModule(mod_covid_server, "covid_ui_1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.