View source: R/tm_file_viewer.R
tm_file_viewer | R Documentation |
teal
module: File viewerThe file viewer module provides a tool to view static files.
Supported formats include text formats, PDF
, PNG
APNG
,
JPEG
SVG
, WEBP
, GIF
and BMP
.
tm_file_viewer(
label = "File Viewer Module",
input_path = list(`Current Working Directory` = ".")
)
label |
( |
input_path |
( 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. |
Object of class teal_module
to be used in teal
applications.
data <- teal_data()
data <- within(data, {
data <- data.frame(1)
})
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"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.