From 2048360f7b62cc54991b3dbd284389f1f92b3b89 Mon Sep 17 00:00:00 2001 From: Venkat Malladi <venkat.malladi@utsouthwestern.edu> Date: Fri, 15 Jun 2018 12:53:04 -0500 Subject: [PATCH] update vizapp. --- vizapp/server.R | 20 ++++++++++++++++++++ vizapp/ui.R | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 vizapp/server.R create mode 100644 vizapp/ui.R diff --git a/vizapp/server.R b/vizapp/server.R new file mode 100644 index 0000000..81017c8 --- /dev/null +++ b/vizapp/server.R @@ -0,0 +1,20 @@ +# This example implements a simple file browser for accessing results. + +library(shiny) +library(shinyFiles) + +# Results are available in the directory specified by the outputDir environment +# variable, red by Sys.getenv + +rootdir <- Sys.getenv('outputDir') + + +shinyServer(function(input, output, session) { + + # The backend for a simple file chooser, restricted to the + # rootdir we obtained above. + # See https://github.com/thomasp85/shinyFiles + + shinyFileChoose(input, 'files', roots=c('workflow'=rootdir), filetypes=c('', 'bed', 'xls','wig'), session=session) + +}) diff --git a/vizapp/ui.R b/vizapp/ui.R new file mode 100644 index 0000000..79f4cc9 --- /dev/null +++ b/vizapp/ui.R @@ -0,0 +1,30 @@ +library(shiny) +library(shinyFiles) + + +shinyUI(fluidPage( + + verticalLayout( + + # Application title + titlePanel("Astrocyte Example"), + + wellPanel( + + helpText("This is a minimal example, demonstrating how + a Shiny visualization application can access the output of a workflow. + Here we provide a file browser using the shinyFiles package. Real + Astrocyte vizapps would provide custom methods to access and visualize + output."), + + helpText("The workflow output is in the directory set in the + outputDir environment variable. this can be retrieved in R with the + command Sys.getenv('outputDir')"), + + # A simple file browser within the workflow output directory + # See https://github.com/thomasp85/shinyFiles + shinyFilesButton('files', label='Browse workflow output', title='Please select a file', multiple=FALSE) + + ) + ) +)) -- GitLab