mod_caseBoxes: caseBoxes UI Function

Description Usage Arguments Examples

Description

A shiny Module for displaying the number by type as colored boxes.

Usage

1
2
3
mod_caseBoxes_ui(id)

mod_caseBoxes_server(input, output, session, counts, param)

Arguments

id, input, output, session

Internal parameters for shiny.

counts

Reactive expression yielding the named vector of cases by type.

param

type of measure: weight, temperature, length

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
if (interactive()) {
  library(shiny)
  ui <- fluidPage(
    tagList(
      babyApp:::mod_caseBoxes_ui("boxes")
    )
  )
  server <- function(input, output, session) {
    counts <- reactive({
      # invalidateLater(2000)
      stats::setNames(sample.int(1000, 3), c("mean_today", "mean_week", "mean_month"))
    })
    callModule(babyApp:::mod_caseBoxes_server, "boxes", counts = counts, param = "weight")
  }
  runApp(shinyApp(ui = ui, server = server), launch.browser = TRUE)
}

fvitalini/babyApp documentation built on May 8, 2020, 1:03 a.m.