tidycwl_shiny {tidycwl} | R Documentation |
Shiny bindings for tidycwl
Description
Output and renderer functions for using tidycwl within Shiny apps and interactive R Markdown documents.
Usage
cwl_output(outputId, width = "100%", height = "600px")
render_cwl(expr, env = parent.frame(), quoted = FALSE)
Arguments
outputId |
output variable to read from |
width , height |
Must be a valid CSS unit (like |
expr |
An expression that generates a CWL graph |
env |
The environment in which to evaluate |
quoted |
Is |
Value
An output or render function that enables the use of the widget within Shiny apps.
Examples
if (interactive()) {
library("shiny")
library("tidycwl")
cwl_folder <- system.file("cwl/sbg/workflow/", package = "tidycwl")
file_all <- list.files(cwl_folder)
cwl_name <- file_all[which(tools::file_ext(file_all) == "json")]
ui <- fluidPage(
selectInput("cwl_file", "Select a CWL file:", cwl_name),
cwl_output("cwl_plot", height = "800px")
)
server <- function(input, output, session) {
output$cwl_plot <- render_cwl({
flow <- paste0(cwl_folder, input$cwl_file) %>% read_cwl_json()
get_graph(
flow %>% parse_inputs(),
flow %>% parse_outputs(),
flow %>% parse_steps()
) %>% visualize_graph()
})
}
shinyApp(ui, server)
}
[Package tidycwl version 1.0.7 Index]