results_boxes: UI function for results boxes module

Description Usage Arguments Value Examples

Description

This function outputs the html tags needed to create UI for the successes, warnings, and failures results boxes.

This gives functionality to the results boxes module UI, attaching titles and populating the validation results.

Usage

1
2
3
results_boxes_ui(id)

results_boxes_server(input, output, session, results)

Arguments

id

The module id.

input

The input from shiny::callModule().

output

The output from shiny::callModule().

session

The session from shiny::callModule().

results

List of the validation results. If NULL, box titles will be default strings (i.e. "Successess (0)"); otherwise, the boxes will be populated with the results.

Value

The html UI for the module.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library("shiny")
library("shinydashboard")

server <- function(input, output) {
  # Create some sample results
  res <- list(
    check_pass(msg = "All good!", behavior = "Values should be >10"),
    check_fail(
      msg = "Some values are too small",
      behavior = "Values should be > 10",
      data = c(5.5, 1.3)
    )
  )
  # Show results in boxes
  callModule(results_boxes_server, "Validation Results", res)
}

ui <- function(request) {
  dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      includeCSS(
        system.file("app/www/custom.css", package = "dccvalidator")
      ),
      results_boxes_ui("Validation Results")
    )
  )
}
## Not run: 
shinyApp(ui, server)

## End(Not run)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.