Commit 8f00e050 authored by mmassaviol's avatar mmassaviol
Browse files

Update show dag and report inside the app

parent b75c7b23
......@@ -587,18 +587,13 @@ generate_pages_server <- function() {
res <- res + '\t}\n'
res <- res + '\twrite_yaml(c,"/results/params.yml",handlers=list(logical = logical))\n'
res <- res + '\tsystem("'+ APP$DAG$command + '")\n'
res <- res + '\ti = sample.int(1000,size = 1)\n'
res <- res + '\tsystem(paste0("snakemake -s /workflow/Snakefile --configfile /results/params.yml -d /results --dag | dot -Tsvg -Gratio=0.75 > /results/dag",i,".svg"))\n'
res <- res + '\taddResourcePath("results", "/results")\n'
res <- res + 'output$DAG = removeUI("#dag_svg")\n'
res <- res + 'output$DAG = insertUI(\n'
res <- res + "selector = '#DAG_placeholder',"
res <- res + "ui = tags$div("
res <- res + 'tags$img(src="results/dag.svg",width="100%"),'
res <- res + 'id = "dag_svg",'
res <- res + 'width = "100%",'
res <- res + 'height = "auto"))})\n'
res <- res + 'output$DAG_svg = renderUI({tagList(img(src = paste0("results/dag",i,".svg") ,alt = "DAG of Snakemake jobs",width="100%",height="auto"))})\n'
res <- res + '})\n'
}
# Event Run
res <- res + '#\' Event when use '+ run$shiny_button$name +' button\n'
res <- res + 'observeEvent(input$'+run$shiny_button$name+', {\n\n'
......@@ -656,6 +651,9 @@ generate_pages_server <- function() {
}
res <- res + ', sep = " " ))\n\n'
res <- res + 'addResourcePath("results", "/results")\n'
res <- res + 'output$report_html = renderUI(tags$iframe(src="results/report.html",width="100%", height="900px"))\n\n'
res <- res + '\n\n'
......@@ -689,6 +687,13 @@ generate_menu <- function() {
menu <- "DAG"
res <- res + ' menuItem("'+menu+'", tabName="'+name+'", icon=icon("'+icon+'", lib="font-awesome"), newtab=FALSE),\n\n'
}
if("Report" %in% names(APP)){
name <- "Report"
icon <- "file"
menu <- "Report"
res <- res + ' menuItem("'+menu+'", tabName="'+name+'", icon=icon("'+icon+'", lib="font-awesome"), newtab=FALSE),\n\n'
}
res <- res + ' tags$br(),\n\n'
......@@ -832,7 +837,10 @@ generate_app <- function() {
res <- res + 'source("./pages/pages_def_'+tolower(name)+'.R", local=T)\n'
}
if("DAG" %in% names(APP)){
res <- res + "tabDAG = fluidPage(box(title = 'Dag :', width = 12, status = 'primary', collapsible = TRUE, solidHeader = TRUE, tags$div(id = 'DAG_placeholder')))\n"
res <- res + "tabDAG = fluidPage(box(title = 'DAG :', width = 12, status = 'primary', collapsible = TRUE, solidHeader = TRUE, uiOutput('DAG_svg')))\n"
}
if("Report" %in% names(APP)){
res <- res + "tabReport = fluidPage(box(title = 'Report :', width = 12, status = 'primary', collapsible = TRUE, solidHeader = TRUE, uiOutput('report_html')))\n"
}
res <- res + 'source("./R/menugauche.R", local=T)\n\n'
......@@ -871,6 +879,9 @@ generate_app <- function() {
if("DAG" %in% names(APP)){
res <- res + '\t,tabItem(tabName = "DAG", tabDAG)'
}
if("Report" %in% names(APP)){
res <- res + '\t,tabItem(tabName = "Report", tabReport)'
}
res <- res + ' )\n\n'
res <- res + ')\n\n'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment