Browse code

proving dashboards

pablo-rodr-bio2 authored on 05/05/2021 06:01:52
Showing4 changed files

... ...
@@ -3,33 +3,30 @@ argumentsDataUI <- function(id) {
3 3
   ns <- NS(id)
4 4
   
5 5
   #UI Definition
6
-  column(
7
-    width=3,
8
-    conditionalPanel(
9
-      condition = "input.arg == 'yes'",
10
-      h3("Parameters"),
11
-      wellPanel(fluidRow(
12
-        column(
13
-          12,
14
-          selectInput(ns("method"), "Choose method:",
15
-                      choices = methodChoices),
16
-          selectInput(ns("kcdf"), "Choose kcdf:",
17
-                      c("Gaussian","Poisson","none")),
18
-          radioButtons(ns("absRanking"), "abs.ranking:",
19
-                       c("False" = FALSE,
20
-                         "True" = TRUE)),
21
-          numericInput(ns("minSz"),"min.sz:", value = 1),
22
-          numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):", value = 0),
23
-          radioButtons(ns("mxDiff"), "mx.diff:",
24
-                       c("True" = TRUE,
25
-                         "False" = FALSE)),
26
-          numericInput(ns("tau"),"tau:", value = 1),
27
-          radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
28
-                       c("True" = TRUE,
29
-                         "False" = FALSE))
30
-        )))
6
+  conditionalPanel(
7
+    condition = "input.arg == 'yes'",
8
+    h3("Parameters"),
9
+    wellPanel(
10
+      
11
+      selectInput(ns("method"), "Choose method:",
12
+                  choices = methodChoices),
13
+      selectInput(ns("kcdf"), "Choose kcdf:",
14
+                  c("Gaussian","Poisson","none")),
15
+      radioButtons(ns("absRanking"), "abs.ranking:",
16
+                   c("False" = FALSE,
17
+                     "True" = TRUE)),
18
+      numericInput(ns("minSz"),"min.sz:", value = 1),
19
+      numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):", value = 0),
20
+      radioButtons(ns("mxDiff"), "mx.diff:",
21
+                   c("True" = TRUE,
22
+                     "False" = FALSE)),
23
+      numericInput(ns("tau"),"tau:", value = 1),
24
+      radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
25
+                   c("True" = TRUE,
26
+                     "False" = FALSE))
31 27
     )
32 28
   )
29
+  
33 30
 }
34 31
 
35 32
 argumentsDataServer <- function(id){
... ...
@@ -10,6 +10,7 @@ library(future)
10 10
 library(promises)
11 11
 library(shinyjs)
12 12
 library(shinybusy)
13
+library(shinydashboard)
13 14
 plan(multisession)
14 15
 source("argumentsDataModule.R")
15 16
 source("modalGSVAModule.R")
... ...
@@ -1,64 +1,59 @@
1
-fluidPage( 
2
-  theme = shinytheme("spacelab"),
3
-  shinyjs::useShinyjs(),
4
-  add_busy_spinner(spin = "double-bounce", position = "bottom-right",
5
-                   height = "100px", width = "100px"),
6
-  tags$head(
7
-    tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
1
+dashboardPage(
2
+  title = "GSVA Shiny Application",
3
+  dashboardHeader(
4
+    tags$li(class = "dropdown",
5
+            tags$style(".main-header {max-height: 75px}"),
6
+            tags$style(".main-header .logo {height: 75px}"),
7
+            tags$div("GSVA Shiny Application", style = "font-size: 30px; 
8
+                     color: white; font-weight: bold;")
9
+    ),
10
+    title = tags$img(src="GSVA.png", height=75, width=75)
8 11
   ),
9
-  titlePanel( 
10
-    fluidRow(id = "title_gsva",
11
-      column(6,
12
-             h2(id="app_title", "GSVA SHINY APP", align="left")),
13
-      column(6,
14
-             h2(tags$img(src="GSVA.png", align="right", height=75, width=75)))
15
-    ), windowTitle="GSVA"),
16
-  
17
-  fluidRow(
18
-    column(
19
-      width=3,
20
-      h3("Data input"),
21
-      #Select data source
22
-      wellPanel(fluidRow(
23
-        column(
24
-          12,
25
-          matrixUI("matrix1"),
26
-          fluidRow(column(12,
27
-                          HTML("<br>"))),
28
-          geneSetsUI("genes1"),
29
-          HTML("<br>"),
30
-          radioButtons("arg", "Change default settings:",
31
-                       c("No" = "no",
32
-                         "Yes" = "yes")),
33
-          actionButton("button", "Run"),
34
-          fluidRow(
35
-            column(12,
36
-                   HTML("<br>"),
37
-                   downloadUI("download"),
38
-                   closeBtnUI("close")
39
-                   )
40
-            )
41
-          )
42
-      ))
12
+  dashboardSidebar(
13
+    tags$style(".left-side, .main-sidebar {padding-top: 75px}"),
14
+    tags$head(
15
+      tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
43 16
     ),
44
-    mainPanel(width=6,
45
-              tabsetPanel(id = "Panels", type="tabs",
46
-                          tabPanel("Samples",
47
-                                   textOutput("errorsGsva"),
48
-                                   htmlOutput("text1"),
49
-                                   plot1_UI("plot1"),
50
-                                   tableOutput("result")
51
-                                   ),
52
-                          tabPanel("GeneSets",
53
-                                   uiOutput("text2"),
54
-                                   htmlOutput("text3"),
55
-                                   plot2_UI("plot2"),
56
-                                   plot3_UI("plot3")
57
-                          ),
58
-                          tabPanel("Session Info",
59
-                                   verbatimTextOutput("sessionInfo"))
60
-              )
17
+    h3("Data input"),
18
+    #Select data source
19
+    matrixUI("matrix1"),
20
+    br(),
21
+    geneSetsUI("genes1"),
22
+    br(),
23
+    radioButtons("arg", "Change default settings:",
24
+                 c("No" = "no",
25
+                   "Yes" = "yes")),
26
+    actionButton("button", "Run"),
27
+    br(),
28
+    downloadUI("download"),
29
+    closeBtnUI("close")
30
+  ),
31
+  dashboardBody(
32
+    shinyjs::useShinyjs(),
33
+    add_busy_spinner(spin = "double-bounce", position = "bottom-right",
34
+                     height = "100px", width = "100px"),
35
+    box(
36
+      width = 9,
37
+      tabsetPanel(id = "Panels", type="tabs",
38
+                  tabPanel("Samples",
39
+                           textOutput("errorsGsva"),
40
+                           htmlOutput("text1"),
41
+                           plot1_UI("plot1"),
42
+                           tableOutput("result")
43
+                  ),
44
+                  tabPanel("GeneSets",
45
+                           uiOutput("text2"),
46
+                           htmlOutput("text3"),
47
+                           plot2_UI("plot2"),
48
+                           plot3_UI("plot3")
49
+                  ),
50
+                  tabPanel("Session Info",
51
+                           verbatimTextOutput("sessionInfo"))
52
+      )
61 53
     ),
62
-    argumentsDataUI("argumentsInput")
54
+    box(
55
+      width = 3,
56
+      argumentsDataUI("argumentsInput")
57
+    )
63 58
   )
64 59
 )
... ...
@@ -10,4 +10,13 @@ font-weight: bold;
10 10
 #app_title {
11 11
   color: white;
12 12
   font-weight: bold;
13
-}
14 13
\ No newline at end of file
14
+}
15
+/**
16
+.main-header {
17
+  max-height: 75px;
18
+}
19
+
20
+.main-header .logo {
21
+  max-height: 75px;
22
+}
23
+**/
15 24
\ No newline at end of file