Front page module
tm_front_page.RdThis teal module creates a simple front page for teal applications
Arguments
- label
(
character(1)) Label shown in the navigation item for the module.- header_text
character vectortext to be shown at the top of the module, for each element, if named the name is shown first in bold as a header followed by the value. The first element's header is displayed larger than the others- tables
named list of dataframestables to be shown in the module- additional_tags
shiny.tag.listorhtmladditional shiny tags orhtmlto be included after the table, for example to include an image,tagList(tags$img(src = "image.png"))or to include furtherhtml,HTML("html text here")- footnotes
character vectortext to be shown at the bottom of the module, for each element, if named the name is shown first in bold, followed by the value- show_metadata
logicalshould the metadata of the datasets be available on the module?
Examples
library(scda)
table_1 <- data.frame(Info = c("A", "B"), Text = c("A", "B"))
table_2 <- data.frame(`Column 1` = c("C", "D"), `Column 2` = c(5.5, 6.6), `Column 3` = c("A", "B"))
table_3 <- data.frame(Info = c("E", "F"), Text = c("G", "H"))
table_input <- list(
"Table 1" = table_1,
"Table 2" = table_2,
"Table 3" = table_3
)
ADSL <- synthetic_cdisc_data("latest")$adsl
app <- init(
data = cdisc_data(
cdisc_dataset("ADSL", ADSL,
code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl",
metadata = list("Author" = "NEST team", "data_source" = "synthetic data")
),
check = TRUE
),
modules = modules(
tm_front_page(
header_text = c(
"Important information" = "It can go here.",
"Other information" = "Can go here."
),
tables = table_input,
additional_tags = HTML("Additional HTML or shiny tags go here <br>"),
footnotes = c("X" = "is the first footnote", "Y is the second footnote"),
show_metadata = TRUE
)
),
header = tags$h1("Sample Application"),
footer = tags$p("Application footer"),
)
#> [INFO] 2022-10-14 01:38:23.5691 pid:2564 token:[] teal.modules.general Initializing tm_front_page
if (FALSE) {
shinyApp(app$ui, app$server)
}