Commit 4b9eea59 authored by jlopez's avatar jlopez
Browse files

add boxes

parent aa78619b
......@@ -23,7 +23,7 @@ style <- tags$style(HTML(readLines("www/added_styles.css")))
UI <- dashboardPage(
skin="green",
skin="purple",
dashboardHeader(title="Pipeline in R", titleWidth=230),
......
tabinput2 = fluidPage(
box(title = "Parameters :", width = 4, status = "primary", collapsible = TRUE, solidHeader = TRUE,
box(title = "Parameters :", width = 5, status = "primary", collapsible = TRUE, solidHeader = TRUE,
tabsetPanel(type = "tabs",
tabPanel("Biblio", height = "300px", style = "overflow: hidden; overflow-y:scroll",
textInput("first_name", label = "First name :", value = "", width = "400px"),
tabPanel("Biblio", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectinformations_user", label = "Select the tool to use : ", choices = list("D" = "D")),
box(title = "Tool D :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("first_name", label = "First name :", value = "", width = "auto"),
textInput("last_name", label = "Last name :", value = "", width = "400px")
textInput("last_name", label = "Last name :", value = "", width = "auto")
)
)
......@@ -15,7 +19,7 @@ tabPanel("Biblio", height = "300px", style = "overflow: hidden; overflow-y:scrol
),
box(title = "Results :", width = 8, status = "primary", collapsible = TRUE, solidHeader = TRUE, style = "overflow: hidden; overflow-x:scroll",
box(title = "Results :", width = 7, status = "primary", collapsible = TRUE, solidHeader = TRUE, style = "overflow: hidden; overflow-x:scroll",
actionButton("runApp", "Run", icon("play"), class="btn btn-primary"),
......
tabinputs = fluidPage(
box(title = "Parameters :", width = 4, status = "primary", collapsible = TRUE, solidHeader = TRUE,
box(title = "Parameters :", width = 5, status = "primary", collapsible = TRUE, solidHeader = TRUE,
tabsetPanel(type = "tabs",
tabPanel("Param panel 1", height = "300px", style = "overflow: hidden; overflow-y:scroll",
textInput("param1", label = "Input Param1 :", value = "", width = "400px"),
tabPanel("Param panel 1", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectpanel1", label = "Select the tool to use : ", choices = list("A" = "A", "B" = "B")),
box(title = "Tool A :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("param1", label = "Input Param1 :", value = "", width = "auto"),
sliderInput("param2", label = "Slider param2 :", min = 0, max = 100, step = 1, width = "400px", value = 50),
sliderInput("param2", label = "Slider param2 :", min = 0, max = 100, step = 1, width = "auto", value = 50),
sliderInput("param3", label = "Slider param3 :", min = 10, max = 20, step = 0.1, width = "400px", value = c(11.8,19.6)),
sliderInput("param3", label = "Slider param3 :", min = 10, max = 20, step = 0.1, width = "auto", value = c(11.8,19.6)),
selectInput("param4", label = "Selected param4 :", choices = list("A" = "A", "B" = "B", "C" = "C"), selected = "B", width = "400px"),
checkboxInput("param8", label = "Checkbox 1", value = TRUE),
selectInput("param5", label = "Selected param5 :", choices = list("1" = 1, "2" = 2, "3" = 3), selected = "3", width = "400px"),
checkboxInput("param9", label = "Checkbox 2", value = FALSE),
checkboxInput("param8", label = "Checkbox 1", value = TRUE),
actionButton("testButton", "Test", class="btn btn-success")
checkboxInput("param9", label = "Checkbox 2", value = FALSE),
),
actionButton("testButton", "Test", class="btn btn-success"),
box(title = "Tool B :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
selectInput("param4", label = "Selected param4 :", choices = list("A" = "A", "B" = "B", "C" = "C"), selected = "B", width = "auto"),
actionButton("testButton2", "", icon("play"), class="btn btn-danger"),
selectInput("param5", label = "Selected param5 :", choices = list("1" = 1, "2" = 2, "3" = 3), selected = "3", width = "auto"),
p("Just simple text for description or help")
actionButton("testButton2", "", icon("play"), class="btn btn-danger"),
p("Just simple text for description or help")
)
),
tabPanel("Param panel 2", height = "300px", style = "overflow: hidden; overflow-y:scroll",
textInput("param10", label = "Input Param 10 :", value = "", width = "400px"),
tabPanel("Param panel 2", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectpanel2", label = "Select the tool to use : ", choices = list("C" = "C")),
box(title = "Tool C :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("param10", label = "Input Param 10 :", value = "", width = "auto"),
radioButtons("param6", label = "Radio param6 :", choices = list("rad1" = "rad1", "rad2" = "rad2", "rad3" = "rad3"), selected = "rad1", width = "auto"),
radioButtons("param6", label = "Radio param6 :", choices = list("rad1" = "rad1", "rad2" = "rad2", "rad3" = "rad3"), selected = "rad1", width = "400px"),
fileInput("param7", label = "Chose file :", accept = c(".csv", ".xslx"), multiple = FALSE, width = "auto")
fileInput("param7", label = "Chose file :", accept = c(".csv", ".xslx"), multiple = FALSE, width = "400px")
)
),
......@@ -46,7 +57,7 @@ tabPanel("Param panel 5", height = "300px", style = "overflow: hidden; overflow-
),
box(title = "Results :", width = 8, status = "primary", collapsible = TRUE, solidHeader = TRUE, style = "overflow: hidden; overflow-x:scroll",
box(title = "Results :", width = 7, status = "primary", collapsible = TRUE, solidHeader = TRUE, style = "overflow: hidden; overflow-x:scroll",
actionButton("runP", "Run pipeline", icon("save"), class="btn btn-primary"),
......
param1: "tutu"
param2: 50
param3_min: 11.8
param3_max: 19.6
param3_step: 0.1
param4: "B"
param5: 3
param8: true
param9: false
param10: ""
param7: ""
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
......@@ -13,18 +13,23 @@ observeEvent(input$runApp, {
res <- ""
# Panel : informations_user
if(!is.na(as.numeric(input$first_name))) {
res <- paste(res, "first_name:", input$first_name, "\n", sep = " ")
} else {
res <- paste(res, "first_name:", paste0('"', input$first_name, '"'), "\n", sep = " ")
}
if(!is.na(as.numeric(input$last_name))) {
res <- paste(res, "last_name:", input$last_name, "\n", sep = " ")
} else {
res <- paste(res, "last_name:", paste0('"', input$last_name, '"'), "\n", sep = " ")
}
# Tool : D
if(input$selectinformations_user == "D") {
if(!is.na(as.numeric(input$first_name))) {
res <- paste(res, "first_name:", input$first_name, "\n", sep = " ")
} else {
res <- paste(res, "first_name:", paste0('"', input$first_name, '"'), "\n", sep = " ")
}
if(!is.na(as.numeric(input$last_name))) {
res <- paste(res, "last_name:", input$last_name, "\n", sep = " ")
} else {
res <- paste(res, "last_name:", paste0('"', input$last_name, '"'), "\n", sep = " ")
}
}
write(res, file=path_param)
......
......@@ -17,64 +17,77 @@ observeEvent(input$runP, {
res <- ""
# Panel : panel1
if(!is.na(as.numeric(input$param1))) {
res <- paste(res, "param1:", input$param1, "\n", sep = " ")
} else {
res <- paste(res, "param1:", paste0('"', input$param1, '"'), "\n", sep = " ")
}
res <- paste(res, "param2:", input$param2, "\n", sep = " ")
# Tool : A
res <- paste(res, "param3_min:", input$param3[1], "\n", sep = " ")
res <- paste(res, "param3_max:", input$param3[2], "\n", sep = " ")
res <- paste(res, "param3_step:", "0.1", "\n", sep = " ")
if(input$selectpanel1 == "A") {
if(!is.na(as.numeric(input$param1))) {
res <- paste(res, "param1:", input$param1, "\n", sep = " ")
} else {
res <- paste(res, "param1:", paste0('"', input$param1, '"'), "\n", sep = " ")
}
res <- paste(res, "param2:", input$param2, "\n", sep = " ")
if(!is.na(as.numeric(input$param4))) {
res <- paste(res, "param4:", input$param4, "\n", sep = " ")
} else {
res <- paste(res, "param4:", paste0('"', input$param4, '"'), "\n", sep = " ")
}
res <- paste(res, "param3_min:", input$param3[1], "\n", sep = " ")
res <- paste(res, "param3_max:", input$param3[2], "\n", sep = " ")
res <- paste(res, "param3_step:", "0.1", "\n", sep = " ")
if(!is.na(as.numeric(input$param5))) {
res <- paste(res, "param5:", input$param5, "\n", sep = " ")
} else {
res <- paste(res, "param5:", paste0('"', input$param5, '"'), "\n", sep = " ")
}
if(input$param8) {
res <- paste(res, "param8:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param8:", "false", "\n", sep = " ")
}
if(input$param8) {
res <- paste(res, "param8:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param8:", "false", "\n", sep = " ")
}
if(input$param9) {
res <- paste(res, "param9:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param9:", "false", "\n", sep = " ")
}
if(input$param9) {
res <- paste(res, "param9:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param9:", "false", "\n", sep = " ")
}
# Tool : B
if(input$selectpanel1 == "B") {
if(!is.na(as.numeric(input$param4))) {
res <- paste(res, "param4:", input$param4, "\n", sep = " ")
} else {
res <- paste(res, "param4:", paste0('"', input$param4, '"'), "\n", sep = " ")
}
if(!is.na(as.numeric(input$param5))) {
res <- paste(res, "param5:", input$param5, "\n", sep = " ")
} else {
res <- paste(res, "param5:", paste0('"', input$param5, '"'), "\n", sep = " ")
}
# Panel : panel2
if(!is.na(as.numeric(input$param10))) {
res <- paste(res, "param10:", input$param10, "\n", sep = " ")
} else {
res <- paste(res, "param10:", paste0('"', input$param10, '"'), "\n", sep = " ")
}
res <- paste(res, "param7:", paste0('"', input$param7$datapath, '"'), "\n", sep = " ")
# Panel : panel2
# Tool : C
if(input$selectpanel2 == "C") {
if(!is.na(as.numeric(input$param10))) {
res <- paste(res, "param10:", input$param10, "\n", sep = " ")
} else {
res <- paste(res, "param10:", paste0('"', input$param10, '"'), "\n", sep = " ")
}
# Panel : panel3
res <- paste(res, "param7:", paste0('"', input$param7$datapath, '"'), "\n", sep = " ")
}
# Panel : panel4
# Panel : panel3
# Panel : panel5
# Panel : panel4
# Panel : panel5
write(res, file=path_param)
system(paste(" python", "", "/home/jimmy/jimmy/projets/sag/app/mon_script.py" , "-i3", "input$param6" , "-t", "input$param1" , "", "input$param4" , "-path1", "input$param7$datapath" , "-params_file", "/home/jimmy/jimmy/projets/sag/app/pipeline/params/params_inputs.yml", sep = " " ))
......
......@@ -2,7 +2,7 @@ App:
project: "/home/jimmy/jimmy/projets/sag/app/pipeline" # important : if dir exist we delete all tree directory
general:
title: "Pipeline in R"
skin: "green" # other color : https://rstudio.github.io/shinydashboard/appearance.html
skin: "purple" # other color : https://rstudio.github.io/shinydashboard/appearance.html
menu_width: 230
pages: [ # important : no space in 'name' field and unique 'name' in all file
......@@ -14,45 +14,67 @@ App:
{
panel: "Param panel 1",
name: "panel1",
content: [# type possible : text, slider, select, radio, checkbox, file, button, help
{name: "param1", type: "text", value: "", label: "Input Param1 :"},
{name: "param2", type: "slider", min: 0, max: 100, step: 1, value: [50], label: "Slider param2 :"},
{name: "param3", type: "slider", min: 10, max: 20, step: 0.1, value: [11.8, 19.6], label: "Slider param3 :"} , # slider max 2 numeric value
{name: "param4", type: "select", selected: "B", choices: ["A", "B", "C"], label: "Selected param4 :"},
{name: "param5", type: "select", selected: 3, choices: [1, 2, 3], label: "Selected param5 :"},
{name: "param8", type: "checkbox", value: TRUE, label: "Checkbox 1"},
{name: "param9", type: "checkbox", value: FALSE, label: "Checkbox 2"},
{name: "testButton", type: "button", icon: "", class: "btn btn-success", label: "Test"}, # class : primary, success, danger, warning, info
{name: "testButton2", type: "button", icon: "play", class: "btn btn-danger", label: ""},
boxes: [
{
name: "A",
title: "Tool A :",
status: "success", # status : primary, success, danger, warning, info
content: [# type possible : text, slider, select, radio, checkbox, file, button, help
{name: "param1", type: "text", value: "", label: "Input Param1 :"},
{name: "param2", type: "slider", min: 0, max: 100, step: 1, value: [50], label: "Slider param2 :"},
{name: "param3", type: "slider", min: 10, max: 20, step: 0.1, value: [11.8, 19.6], label: "Slider param3 :"} , # slider max 2 numeric value
{name: "help1", type: "help", label: "Just simple text for description or help"}
{name: "param8", type: "checkbox", value: TRUE, label: "Checkbox 1"},
{name: "param9", type: "checkbox", value: FALSE, label: "Checkbox 2"},
{name: "testButton", type: "button", icon: "", class: "btn btn-success", label: "Test"}, # class : primary, success, danger, warning, info
]
},
{
name: "B",
title: "Tool B :",
status: "success",
content: [
{name: "param4", type: "select", selected: "B", choices: ["A", "B", "C"], label: "Selected param4 :"},
{name: "param5", type: "select", selected: 3, choices: [1, 2, 3], label: "Selected param5 :"},
{name: "testButton2", type: "button", icon: "play", class: "btn btn-danger", label: ""},
{name: "help1", type: "help", label: "Just simple text for description or help"}
]
}
]
} ,
{
panel: "Param panel 2",
name: "panel2",
content: [
{name: "param10", type: "text", value: "", label: "Input Param 10 :"},
{name: "param6", type: "radio", selected: "rad1", choices: ["rad1", "rad2", "rad3"], label: "Radio param6 :"},
{name: "param7", type: "file", multiple: FALSE, accept: [".csv", ".xslx"], label: "Chose file :"}
boxes: [
{
name: "C",
title: "Tool C :",
status: "success",
content: [
{name: "param10", type: "text", value: "", label: "Input Param 10 :"},
{name: "param6", type: "radio", selected: "rad1", choices: ["rad1", "rad2", "rad3"], label: "Radio param6 :"},
{name: "param7", type: "file", multiple: FALSE, accept: [".csv", ".xslx"], label: "Chose file :"}
]
}
]
},
{
panel: "Param panel 3",
name: "panel3",
content: [
boxes: [
]
},
{
panel: "Param panel 4",
name: "panel4",
content: [
boxes: [
]
},
{
panel: "Param panel 5",
name: "panel5",
content: [
boxes: [
]
}
],
......@@ -81,9 +103,16 @@ App:
{
panel: "Biblio",
name: "informations_user",
content: [
{name: "first_name", type: "text", value: "", label: "First name :"},
{name: "last_name", type: "text", value: "", label: "Last name :"}
boxes: [
{
name: "D",
title: "Tool D :",
status: "success",
content: [
{name: "first_name", type: "text", value: "", label: "First name :"},
{name: "last_name", type: "text", value: "", label: "Last name :"}
]
}
]
}
],
......
......@@ -52,28 +52,28 @@ generate_page_input <- function(res, cnt) {
if(cnt$type == "button") {
if(cnt$icon == "") {
res <- res + '\tactionButton("' + cnt$name + '", "'+ cnt$label +'", class="'+ cnt$class +'")'
res <- res + '\t\tactionButton("' + cnt$name + '", "'+ cnt$label +'", class="'+ cnt$class +'")'
} else {
res <- res + '\tactionButton("' + cnt$name + '", "'+ cnt$label +'", icon("'+ cnt$icon +'"), class="'+ cnt$class +'")'
res <- res + '\t\tactionButton("' + cnt$name + '", "'+ cnt$label +'", icon("'+ cnt$icon +'"), class="'+ cnt$class +'")'
}
} else if(cnt$type == "text") {
res <- res + '\ttextInput("'+ cnt$name +'", label = "'+ cnt$label +'", value = "'+ cnt$value +'", width = "'+ '400px' +'")'
res <- res + '\t\ttextInput("'+ cnt$name +'", label = "'+ cnt$label +'", value = "'+ cnt$value +'", width = "'+ 'auto' +'")'
} else if(cnt$type == "slider") {
if(length(cnt$value) == 1) {
res <- res + '\tsliderInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ '400px' +'", value = '+ cnt$value +')'
res <- res + '\t\tsliderInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ 'auto' +'", value = '+ cnt$value +')'
} else {
res <- res + '\tsliderInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ '400px' +'", value = c('+ cnt$value[1] + ',' + cnt$value[2] + '))'
res <- res + '\t\tsliderInput("'+ cnt$name +'", label = "'+ cnt$label +'", min = '+ cnt$min +', max = '+ cnt$max +', step = '+ cnt$step +', width = "'+ 'auto' +'", value = c('+ cnt$value[1] + ',' + cnt$value[2] + '))'
}
} else if(cnt$type == "help") {
res <- res + '\tp("'+cnt$label+'")'
res <- res + '\t\tp("'+cnt$label+'")'
} else if(cnt$type == "select") {
res <- res + '\tselectInput("'+ cnt$name +'", label = "'+ cnt$label +'", choices = list('
res <- res + '\t\tselectInput("'+ cnt$name +'", label = "'+ cnt$label +'", choices = list('
if(length(cnt$choices) > 0) {
......@@ -95,11 +95,11 @@ generate_page_input <- function(res, cnt) {
}
}
res <- res + ' selected = "'+cnt$selected+'"' + ', width = "'+ '400px' +'")'
res <- res + ' selected = "'+cnt$selected+'"' + ', width = "'+ 'auto' +'")'
} else if(cnt$type == "radio") {
res <- res + '\tradioButtons("'+ cnt$name +'", label = "'+ cnt$label +'", choices = list('
res <- res + '\t\tradioButtons("'+ cnt$name +'", label = "'+ cnt$label +'", choices = list('
if(length(cnt$choices) > 0) {
for(ch in 1:length(cnt$choices)){
......@@ -120,16 +120,16 @@ generate_page_input <- function(res, cnt) {
}
}
res <- res + ' selected = "'+cnt$selected+'"' + ', width = "'+ '400px' +'")'
res <- res + ' selected = "'+cnt$selected+'"' + ', width = "'+ 'auto' +'")'
} else if(cnt$type == "checkbox") {
res <- res + '\tcheckboxInput("'+ cnt$name +'", label = "'+ cnt$label +'", value = ' + cnt$value + ')'
res <- res + '\t\tcheckboxInput("'+ cnt$name +'", label = "'+ cnt$label +'", value = ' + cnt$value + ')'
} else if(cnt$type == "checkboxGroupInput") {
res <- res + '\tcheckboxGroupInput("'+ cnt$name +'",label = "'+ cnt$label +'", choices = list('
res <- res + '\t\tcheckboxGroupInput("'+ cnt$name +'",label = "'+ cnt$label +'", choices = list('
if(length(cnt$choices) > 0) {
for(ch in 1:length(cnt$choices)){
......@@ -150,11 +150,11 @@ generate_page_input <- function(res, cnt) {
}
}
res <- res + '), selected = "'+cnt$selected+'"' + ', width = "'+ '400px' +'")'
res <- res + '), selected = "'+cnt$selected+'"' + ', width = "'+ 'auto' +'")'
} else if(cnt$type == "file") {
res <- res + '\tfileInput("'+ cnt$name +'", label = "'+ cnt$label + '"'
res <- res + '\t\tfileInput("'+ cnt$name +'", label = "'+ cnt$label + '"'
if(length(cnt$accept) > 0) {
......@@ -176,7 +176,7 @@ generate_page_input <- function(res, cnt) {
}
res <- res + ', multiple = ' + cnt$multiple + ', width = "'+ '400px' + '")'
res <- res + ', multiple = ' + cnt$multiple + ', width = "'+ 'auto' + '")'
}
......@@ -193,7 +193,7 @@ generate_pages_server <- function() {
res <- 'tab'+ name + ' = fluidPage(\n\n'
res <- res + 'box(title = "Parameters :", width = 4, status = "primary", collapsible = TRUE, solidHeader = TRUE'
res <- res + 'box(title = "Parameters :", width = 5, status = "primary", collapsible = TRUE, solidHeader = TRUE'
content <- APP$pages[[x]]$content
......@@ -208,27 +208,66 @@ generate_pages_server <- function() {
res <- res + 'tabPanel("' + panel$panel + '", height = "300px", style = "overflow: hidden; overflow-y:scroll"'
panel_content = panel$content
if(length(panel_content) > 0) {
res <- res + ',\n'
panel_boxes = panel$boxes
for(z in 1:length(panel_content)) {
if(length(panel_boxes) > 0) {
res <- res + ', br(),\n'
res <- res + '\tselectInput("select' + panel$name + '", label = "Select the tool to use : ", choices = list('
for(b in 1:length(panel_boxes)) { # construction list box tools
res <- res + '"' + panel_boxes[[b]]$name +'" = "' + panel_boxes[[b]]$name + '"'
cnt <- panel_content[[z]]
if(b < length(panel_boxes)) {
res <- res + ', '
}
}
res <- generate_page_input(res, cnt)
res <- res + ')),\n'
if(z < length(panel_content)) {
res <- res + ',\n\n'
} else {