The file viewer module provides a tool to view static files.
Supported formats include text formats, PDF
, PNG
APNG
,
JPEG
SVG
, WEBP
, GIF
and BMP
.
Usage
tm_file_viewer(
label = "File Viewer Module",
input_path = list(`Current Working Directory` = ".")
)
Arguments
- label
(
character(1)
) Label shown in the navigation item for the module or module group. Formodules()
defaults to"root"
. SeeDetails
.- input_path
-
(
list
) of the input paths, optional. Each element can be:Paths can be specified as absolute paths or relative to the running directory of the application. Default to the current working directory if not supplied.
Examples
data <- teal_data()
data <- within(data, {
data <- data.frame(1)
})
datanames(data) <- c("data")
app <- init(
data = data,
modules = modules(
tm_file_viewer(
input_path = list(
folder = system.file("sample_files", package = "teal.modules.general"),
png = system.file("sample_files/sample_file.png", package = "teal.modules.general"),
txt = system.file("sample_files/sample_file.txt", package = "teal.modules.general"),
url = "https://fda.gov/files/drugs/published/Portable-Document-Format-Specifications.pdf"
)
)
)
)
#> [INFO] 2024-03-05 18:46:04.9832 pid:1279 token:[] teal.modules.general Initializing tm_file_viewer
if (interactive()) {
shinyApp(app$ui, app$server)
}