Browse code

hidden 'genesets' tab and rearrange buttons

pablo-rodr-bio2 authored on 26/04/2021 19:22:13
Showing2 changed files

... ...
@@ -122,10 +122,9 @@ function(input, output, session) {
122 122
 
123 123
   # PLOT2 RENDER
124 124
   eventData1 <- reactive({
125
-    req(rv$dat.t)
125
+    if(is.null(rv$p))return(NULL)
126 126
     ind <- event_data("plotly_click", source = "click1")
127 127
     ind <- ind$curveNumber+1
128
-
129 128
   })
130 129
   plot2_Server("plot2", eventData1, rv)
131 130
 
... ...
@@ -134,7 +133,6 @@ function(input, output, session) {
134 133
     req(rv$p2)
135 134
     ind <- event_data("plotly_click", source = "click2")
136 135
     ind <- ind$pointNumber+1
137
-
138 136
   })
139 137
   plot3_Server("plot3", eventData2, rv, matrix, genesets)
140 138
 
... ...
@@ -161,12 +159,12 @@ function(input, output, session) {
161 159
     }
162 160
   })
163 161
   
164
-  ## HIDE 'GeneSets' PANEL WHILE THERE IS NO GSVA OBJECT
162
+  ## HIDE 'GeneSets' PANEL WHILE THERE IS NO CLICK EVENT ON THE FIRST PLOT
165 163
   observe({
166
-    if(is.null(rv$gs)) {
167
-      hideTab(inputId="Panels", target="GeneSets")
164
+    if( length(eventData1()) == 0){
165
+      hideTab(inputId = "Panels", target = "GeneSets")
168 166
     } else {
169
-      showTab(inputId="Panels", target="GeneSets")
167
+      showTab(inputId = "Panels", target = "GeneSets", select = TRUE)
170 168
     }
171 169
   })
172 170
   
... ...
@@ -29,7 +29,15 @@ fluidPage(
29 29
           radioButtons("arg", "Change default settings:",
30 30
                        c("No" = "no",
31 31
                          "Yes" = "yes")),
32
-          actionButton("button", "Run"))
32
+          actionButton("button", "Run"),
33
+          fluidRow(
34
+            column(12,
35
+                   HTML("<br>"),
36
+                   downloadUI("download"),
37
+                   closeBtnUI("close")
38
+                   )
39
+            )
40
+          )
33 41
       ))
34 42
     ),
35 43
     mainPanel(width=6,
... ...
@@ -38,15 +46,14 @@ fluidPage(
38 46
                                    textOutput("errorsGsva"),
39 47
                                    htmlOutput("text1"),
40 48
                                    plot1_UI("plot1"),
41
-                                   tableOutput("result"),
42
-                                   downloadUI("download"),
43
-                                   closeBtnUI("close")),
49
+                                   tableOutput("result")
50
+                                   ),
44 51
                           tabPanel("GeneSets",
45 52
                                    uiOutput("text2"),
46 53
                                    htmlOutput("text3"),
47 54
                                    plot2_UI("plot2"),
48 55
                                    plot3_UI("plot3")
49
-                                   ),
56
+                          ),
50 57
                           tabPanel("Session Info",
51 58
                                    verbatimTextOutput("sessionInfo"))
52 59
               )