Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
sagJL
Commits
aa78619b
Commit
aa78619b
authored
Oct 19, 2018
by
jlopez
Browse files
Big update
parent
c9561c67
Changes
18
Hide whitespace changes
Inline
Side-by-side
app/cars.csv
0 → 100644
View file @
aa78619b
"","mpg","cyl","disp","hp","drat","wt","qsec","vs","am","gear","carb"
"Mazda RX4",21,6,160,110,3.9,2.62,16.46,0,1,4,4
"Mazda RX4 Wag",21,6,160,110,3.9,2.875,17.02,0,1,4,4
"Datsun 710",22.8,4,108,93,3.85,2.32,18.61,1,1,4,1
"Hornet 4 Drive",21.4,6,258,110,3.08,3.215,19.44,1,0,3,1
"Hornet Sportabout",18.7,8,360,175,3.15,3.44,17.02,0,0,3,2
"Valiant",18.1,6,225,105,2.76,3.46,20.22,1,0,3,1
"Duster 360",14.3,8,360,245,3.21,3.57,15.84,0,0,3,4
"Merc 240D",24.4,4,146.7,62,3.69,3.19,20,1,0,4,2
"Merc 230",22.8,4,140.8,95,3.92,3.15,22.9,1,0,4,2
"Merc 280",19.2,6,167.6,123,3.92,3.44,18.3,1,0,4,4
"Merc 280C",17.8,6,167.6,123,3.92,3.44,18.9,1,0,4,4
"Merc 450SE",16.4,8,275.8,180,3.07,4.07,17.4,0,0,3,3
"Merc 450SL",17.3,8,275.8,180,3.07,3.73,17.6,0,0,3,3
"Merc 450SLC",15.2,8,275.8,180,3.07,3.78,18,0,0,3,3
"Cadillac Fleetwood",10.4,8,472,205,2.93,5.25,17.98,0,0,3,4
"Lincoln Continental",10.4,8,460,215,3,5.424,17.82,0,0,3,4
"Chrysler Imperial",14.7,8,440,230,3.23,5.345,17.42,0,0,3,4
"Fiat 128",32.4,4,78.7,66,4.08,2.2,19.47,1,1,4,1
"Honda Civic",30.4,4,75.7,52,4.93,1.615,18.52,1,1,4,2
"Toyota Corolla",33.9,4,71.1,65,4.22,1.835,19.9,1,1,4,1
"Toyota Corona",21.5,4,120.1,97,3.7,2.465,20.01,1,0,3,1
"Dodge Challenger",15.5,8,318,150,2.76,3.52,16.87,0,0,3,2
"AMC Javelin",15.2,8,304,150,3.15,3.435,17.3,0,0,3,2
"Camaro Z28",13.3,8,350,245,3.73,3.84,15.41,0,0,3,4
"Pontiac Firebird",19.2,8,400,175,3.08,3.845,17.05,0,0,3,2
"Fiat X1-9",27.3,4,79,66,4.08,1.935,18.9,1,1,4,1
"Porsche 914-2",26,4,120.3,91,4.43,2.14,16.7,0,1,5,2
"Lotus Europa",30.4,4,95.1,113,3.77,1.513,16.9,1,1,5,2
"Ford Pantera L",15.8,8,351,264,4.22,3.17,14.5,0,1,5,4
"Ferrari Dino",19.7,6,145,175,3.62,2.77,15.5,0,1,5,6
"Maserati Bora",15,8,301,335,3.54,3.57,14.6,0,1,5,8
"Volvo 142E",21.4,4,121,109,4.11,2.78,18.6,1,1,4,2
app/mon_script.py
0 → 100644
View file @
aa78619b
#!/usr/bin/python
import
time
print
"Start : %s"
%
time
.
ctime
()
time
.
sleep
(
1
)
print
"End : %s"
%
time
.
ctime
()
app/pipeline/R/menugauche.R
View file @
aa78619b
MenuGauche
=
sidebarMenu
(
id
=
"sidebarmenu"
,
menuItem
(
""
,
tabName
=
"inputs"
,
icon
=
icon
(
"pencil"
,
lib
=
"font-awesome"
),
newtab
=
FALSE
),
menuItem
(
"
Input Pipeline 1
"
,
tabName
=
"inputs"
,
icon
=
icon
(
"pencil"
,
lib
=
"font-awesome"
),
newtab
=
FALSE
),
menuItem
(
""
,
tabName
=
"input2"
,
icon
=
icon
(
"file"
,
lib
=
"font-awesome"
),
newtab
=
FALSE
),
menuItem
(
"
Input Pipeline 2
"
,
tabName
=
"input2"
,
icon
=
icon
(
"file"
,
lib
=
"font-awesome"
),
newtab
=
FALSE
),
tags
$
br
(),
...
...
app/pipeline/app.R
View file @
aa78619b
...
...
@@ -9,6 +9,8 @@ library(yaml)
library
(
stringr
)
library
(
shinyFiles
)
library
(
tools
)
library
(
knitr
)
library
(
DT
)
source
(
"./pages/pages_def_inputs.R"
,
local
=
T
)
...
...
app/pipeline/pages/pages_def_.R
0 → 100644
View file @
aa78619b
tab
=
fluidPage
(
)
app/pipeline/pages/pages_def_input2.R
View file @
aa78619b
tabinput2
=
fluidPage
(
box
(
title
=
"Parameters :"
,
width
=
4
,
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"
),
textInput
(
"last_name"
,
label
=
"Last name :"
,
value
=
""
,
width
=
"400px"
)
)
)
),
box
(
title
=
"Results :"
,
width
=
8
,
status
=
"primary"
,
collapsible
=
TRUE
,
solidHeader
=
TRUE
,
style
=
"overflow: hidden; overflow-x:scroll"
,
actionButton
(
"runApp"
,
"Run"
,
icon
(
"play"
),
class
=
"btn btn-primary"
),
br
(),
br
(),
DT
::
dataTableOutput
(
"report_input2"
)
)
)
app/pipeline/pages/pages_def_inputs.R
View file @
aa78619b
tabinputs
=
fluidPage
(
box
(
title
=
"Parameters :"
,
width
=
4
,
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"
),
sliderInput
(
"param2"
,
label
=
"Slider param2 :"
,
min
=
0
,
max
=
100
,
step
=
1
,
width
=
"400px"
,
value
=
50
),
...
...
@@ -10,20 +15,45 @@ tabinputs = fluidPage(
selectInput
(
"param5"
,
label
=
"Selected param5 :"
,
choices
=
list
(
"1"
=
1
,
"2"
=
2
,
"3"
=
3
),
selected
=
"3"
,
width
=
"400px"
),
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
=
"400px"
),
checkboxInput
(
"param8"
,
label
=
"Checkbox 1"
,
value
=
TRUE
),
checkboxInput
(
"param9"
,
label
=
"Checkbox 2"
,
value
=
FALSE
),
actionButton
(
"testButton"
,
"Test"
,
class
=
"btn btn-success"
),
actionButton
(
"
runP
"
,
"
Run
"
,
icon
(
"
save
"
),
class
=
"btn btn-
primary
"
),
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"
),
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
=
"400px"
)
),
tabPanel
(
"Param panel 3"
,
height
=
"300px"
,
style
=
"overflow: hidden; overflow-y:scroll"
),
tabPanel
(
"Param panel 4"
,
height
=
"300px"
,
style
=
"overflow: hidden; overflow-y:scroll"
),
tabPanel
(
"Param panel 5"
,
height
=
"300px"
,
style
=
"overflow: hidden; overflow-y:scroll"
)
)
),
box
(
title
=
"Results :"
,
width
=
8
,
status
=
"primary"
,
collapsible
=
TRUE
,
solidHeader
=
TRUE
,
style
=
"overflow: hidden; overflow-x:scroll"
,
actionButton
(
"runP"
,
"Run pipeline"
,
icon
(
"save"
),
class
=
"btn btn-primary"
),
br
(),
br
(),
uiOutput
(
"report_inputs"
)
)
)
app/pipeline/params/params_input2.yml
0 → 100644
View file @
aa78619b
first_name
:
"
"
last_name
:
"
"
app/pipeline/params/params_inputs.yml
0 → 100644
View file @
aa78619b
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
:
"
"
app/pipeline/result.md
0 → 100644
View file @
aa78619b
salut
```
r
print
(
3+5
)
```
```
## [1] 8
```
app/pipeline/server/opt_.R
0 → 100644
View file @
aa78619b
app/pipeline/server/opt_input2.R
View file @
aa78619b
RV_input2
<-
reactiveValues
(
data
=
data.frame
())
output
$
report_input2
<-
DT
::
renderDataTable
({
return
(
RV_input2
$
data
)
},
filter
=
"top"
,
escape
=
FALSE
,
selection
=
list
(
mode
=
"single"
,
target
=
"cell"
),
rownames
=
FALSE
,
server
=
TRUE
)
#' Event when use runApp button
observeEvent
(
input
$
runApp
,
{
# Params
path_param
<-
"/home/jimmy/jimmy/projets/sag/app/pipeline/params/params_input2.yml"
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
=
" "
)
}
write
(
res
,
file
=
path_param
)
system
(
paste
(
" pwd"
,
""
,
"input$first_name"
,
""
,
"input$last_name"
,
sep
=
" "
))
RV_input2
$
data
<-
read.csv
(
"/home/jimmy/jimmy/projets/sag/app/cars.csv"
,
header
=
TRUE
)
})
app/pipeline/server/opt_inputs.R
View file @
aa78619b
#' Event when use testButton button
observeEvent
(
input
$
testButton
,
{
})
#' Event when use testButton2 button
observeEvent
(
input
$
testButton2
,
{
})
#' Event when use runP button
observeEvent
(
input
$
runP
,
{
print
(
paste0
(
" python /home/jimmy/mon_script.py -i2 "
,
input
$
param6
,
" -t "
,
input
$
param1
,
" "
,
input
$
param4
,
" -path1 "
,
input
$
param7
$
datapath
))
# Params
path_param
<-
"/home/jimmy/jimmy/projets/sag/app/pipeline/params/params_inputs.yml"
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
=
" "
)
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
$
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
=
" "
)
}
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
=
" "
)
}
# 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 : panel3
# 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
=
" "
))
if
(
file.exists
(
"/home/jimmy/jimmy/projets/sag/app/result.Rmd"
))
{
output
$
report_inputs
<-
renderUI
({
includeMarkdown
(
knit
(
"/home/jimmy/jimmy/projets/sag/app/result.Rmd"
,
quiet
=
TRUE
))
})
}
})
...
...
app/pipelineR.yml
View file @
aa78619b
App
:
project
:
"
/home/jimmy/jimmy/projets/sag/app/pipeline"
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
menu_width
:
230
pages
:
[
# important : no space in 'name' field
{
#Page 1
icon
:
"
pencil"
,
# icon possible : https://fontawesome.com/icons?from=io
label
:
"
Input
Pipeline"
,
# the label in left menu
name
:
"
inputs"
,
# the name of the page
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
:
"
param6"
,
type
:
"
radio"
,
selected
:
"
rad1"
,
choices
:
[
"
rad1"
,
"
rad2"
,
"
rad3"
],
label
:
"
Radio
param6
:"
},
{
name
:
"
param7"
,
type
:
"
file"
,
multiple
:
FALSE
,
accept
:
[
"
.csv"
,
"
.xslx"
],
label
:
"
Chose
file
:"
},
{
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
:
"
runP"
,
type
:
"
button"
,
icon
:
"
save"
,
class
:
"
btn
btn-primary"
,
label
:
"
Run"
},
# icon possible : https://fontawesome.com/icons?from=io
{
name
:
"
help1"
,
type
:
"
help"
,
label
:
"
Just
simple
text
for
description
or
help"
}
],
pipeline
:
{
shiny_button
:
"
runP"
,
program
:
"
python"
,
options
:
[
{
name
:
"
/home/jimmy/mon_script.py"
,
shiny_name
:
"
"
},
{
name
:
"
-i2"
,
shiny_name
:
"
param6"
},
{
name
:
"
-t"
,
shiny_name
:
"
param1"
},
{
name
:
"
"
,
shiny_name
:
"
param4"
},
{
name
:
"
-path1"
,
shiny_name
:
"
param7"
}
pages
:
[
# important : no space in 'name' field and unique 'name' in all file
{
#Page 1
icon
:
"
pencil"
,
# icon possible : https://fontawesome.com/icons?from=io
label
:
"
Input
Pipeline
1"
,
# the label in left menu
name
:
"
inputs"
,
# the name of the page
content
:
[
# list the panel
{
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
:
"
"
},
{
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
:"
}
]
},
{
panel
:
"
Param
panel
3"
,
name
:
"
panel3"
,
content
:
[
]
},
{
panel
:
"
Param
panel
4"
,
name
:
"
panel4"
,
content
:
[
]
},
{
panel
:
"
Param
panel
5"
,
name
:
"
panel5"
,
content
:
[
]
}
},
{
#Page 2
name
:
"
input2"
,
icon
:
"
file"
,
label
:
"
Input
Pipeline
2"
,
content
:
[],
pipeline
:
[]
],
pipeline
:
{
shiny_button
:
{
name
:
"
runP"
,
type
:
"
button"
,
icon
:
"
save"
,
class
:
"
btn
btn-primary"
,
label
:
"
Run
pipeline"
},
# icon possible : https://fontawesome.com/icons?from=io
program
:
"
python"
,
options
:
[
{
name
:
"
"
,
type
:
"
value"
,
value
:
"
/home/jimmy/jimmy/projets/sag/app/mon_script.py"
},
{
name
:
"
-i3"
,
type
:
"
shiny"
,
value
:
"
param6"
},
{
name
:
"
-t"
,
type
:
"
shiny"
,
value
:
"
param1"
},
{
name
:
"
"
,
type
:
"
shiny"
,
value
:
"
param4"
},
{
name
:
"
-path1"
,
type
:
"
shiny-file"
,
value
:
"
param7"
},
# diffent because with file input the traitement is different
{
name
:
"
-params_file"
,
type
:
"
panel"
}
# for add the path of yml contain all params
],
output_format
:
"
markdown"
,
output
:
"
/home/jimmy/jimmy/projets/sag/app/result.Rmd"
}
},
{
#Page 2
name
:
"
input2"
,
icon
:
"
file"
,
label
:
"
Input
Pipeline
2"
,
content
:
[
{
panel
:
"
Biblio"
,
name
:
"
informations_user"
,
content
:
[
{
name
:
"
first_name"
,
type
:
"
text"
,
value
:
"
"
,
label
:
"
First
name
:"
},
{
name
:
"
last_name"
,
type
:
"
text"
,
value
:
"
"
,
label
:
"
Last
name
:"
}
]
}
],
pipeline
:
{
shiny_button
:
{
name
:
"
runApp"
,
type
:
"
button"
,
icon
:
"
play"
,
class
:
"
btn
btn-primary"
,
label
:
"
Run"
},
program
:
"
pwd"
,
options
:
[
{
name
:
"
"
,
type
:
"
shiny"
,
value
:
"
first_name"
},
{
name
:
"
"
,
type
:
"
shiny"
,
value
:
"
last_name"
},
],
output_format
:
"
table"
,
output
:
"
/home/jimmy/jimmy/projets/sag/app/cars.csv"
}
}
]
app/result.Rmd
0 → 100644
View file @
aa78619b
salut
```{r, echo=TRUE}
print(3+5)
```
main.R
View file @
aa78619b
...
...
@@ -10,266 +10,450 @@ APP <<- yaml.load_file(path_yml)$App
generate_added_styles
<-
function
()
{
path_css
=
APP
$
project
+
"/www/added_styles.css"
file.
c
re
at
e
(
path_css
)
file.re
plac
e
(
path_css
)
}
#============================================================
generate_button_opt
<-
function
()
{
}
#============================================================
generate_param_yml
<-
function
(
path
,
content
)
{
res
<-
""
for
(
z
in
1
:
length
(
content
))
{
cnt
<-
content
[[
z
]]
if
(
cnt
$
type
==
"text"
)
{
res
<-
res
+
cnt
$
name
+
': '
+
'"'
+
cnt
$
value
+
'"'
}
res
<-
res
+
'\n'
}
write
(
res
,
file
=
path
)
}
#============================================================
generate_page_input
<-
function
(
res
,
cnt
)
{
if
(
cnt
$
type
==
"button"
)
{
if
(
cnt
$
icon
==
""
)
{
res
<-
res
+
'\tactionButton("'
+
cnt
$
name
+
'", "'
+
cnt
$
label
+
'", class="'
+
cnt
$
class
+
'")'
}
else
{
res
<-
res
+
'\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'
+
'")'
}
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
+
')'
}
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
]
+
'))'
}
}
else
if
(
cnt
$
type
==
"help"
)
{
res
<-
res
+
'\tp("'
+
cnt
$
label
+
'")'
}
else
if
(
cnt
$
type
==
"select"
)
{
res
<-
res
+
'\tselectInput("'
+
cnt
$
name
+
'", label = "'
+
cnt
$
label
+
'", choices = list('
if
(
length
(
cnt
$
choices
)
>
0
)
{
for
(
ch
in
1
:
length
(
cnt
$
choices
)){
choices
=
cnt
$
choices
[[
ch
]]
value
=
choices
if
(
is.character
(
choices
))
{
value
=
'"'
+
choices
+
'"'
}
if
(
ch
<
length
(
cnt
$
choices
))
{
res
<-
res
+
'"'
+
choices
+
'"'
+
' = '
+
value
+
', '
}
else
{
res
<-
res
+
'"'
+
choices
+
'"'
+
' = '
+
value
+
'), '
}
}
}
res
<-
res
+
' selected = "'
+
cnt
$
selected
+
'"'
+
', width = "'
+
'400px'
+
'")'
}
else
if
(
cnt
$
type
==
"radio"
)
{
res
<-
res
+
'\tradioButtons("'
+
cnt
$
name
+
'", label = "'
+
cnt
$
label
+
'", choices = list('
if
(
length
(
cnt
$
choices
)
>
0
)
{
for
(
ch
in
1
:
length
(
cnt
$
choices
)){
choices
=
cnt
$
choices
[[
ch
]]
value
=
choices
if
(
is.character
(
choices
))
{
value
=
'"'
+
choices
+
'"'
}
if
(
ch
<
length
(
cnt
$
choices
))
{
res
<-
res
+
'"'
+
choices
+
'"'
+
' = '
+
value
+
', '
}
else
{