@@ -264,51 +264,50 @@ download_feat_Server = function(input, output, session, database = "toil",#id_op
264264 x_data $ cancer = clinical_phe [,2 ,drop = T ][match(x_data $ Sample , clinical_phe $ Sample )]
265265 x_data = x_data [,c(" id" ," level1" ," level2" ," Sample" ," value" ," cancer" )] %> %
266266 dplyr :: arrange(cancer ,Sample )
267- # shinyjs::enable("query_data")
267+ shinyjs :: enable(" query_data" )
268268 x_data
269269 })
270270
271271 w <- waiter :: Waiter $ new(id = ns(" x_axis_data_table" ), html = waiter :: spin_hexdots(), color = " black" )
272272
273- observeEvent(input $ query_data ,{
274-
275- w $ show()
276- output $ x_axis_data_table = renderUI({
277- if (table.ui ){
278- output $ x_tmp_table = renderDataTable({
279- shinyjs :: enable(" query_data" )
280-
281- shiny :: validate(
282- need(try(nrow(download_data())> 0 ),
283- " No sample data available. Please inspect operations in Preset step." ),
284- )
285- if (check_numeric ){
273+ # observeEvent(input$query_data,{
274+ observe({
275+ if (input $ query_data > 0 ) {
276+ w $ show()
277+ output $ x_axis_data_table = renderUI({
278+ if (table.ui ){
279+ output $ x_tmp_table = renderDataTable({
280+ # shinyjs::enable("query_data")
286281 shiny :: validate(
287- need(try(class(download_data()$ value )!= " character" ),
288- " Please select a numeric variable." ),
289- )
290- }
291- x_axis_data_ = download_data()[,c(" Sample" ," value" ," cancer" )]
292-
293- if (class(x_axis_data_ [," value" ])== " numeric" ){
294- x_axis_data_ [," value" ] = round(x_axis_data_ [," value" ], digits = 3 )
295- }
296- datatable(x_axis_data_ ,
297- options = list (pageLength = 3 ,
298- columnDefs = list (list (className = ' dt-center' , targets = " _all" )))
299- )
300- })
301- dataTableOutput(ns(" x_tmp_table" ))
302- } else {
303- output $ x_tmp_table = renderPrint({
304- # ids_num = nrow()
305- cat(paste0(" Tip: identifier values of " , nrow(download_data()), " samples are prepared." ))
306- })
307- verbatimTextOutput(ns(" x_tmp_table" ))
308- }
282+ need(try(nrow(download_data())> 0 ),
283+ " No sample data available. Please inspect operations in Preset step." ),
284+ )
285+ if (check_numeric ){
286+ shiny :: validate(
287+ need(try(class(download_data()$ value )!= " character" ),
288+ " Please select a numeric variable." ),
289+ )
290+ }
291+ x_axis_data_ = download_data()[,c(" Sample" ," value" ," cancer" )]
309292
310- })
311-
293+ if (class(x_axis_data_ [," value" ])== " numeric" ){
294+ x_axis_data_ [," value" ] = round(x_axis_data_ [," value" ], digits = 3 )
295+ }
296+ datatable(x_axis_data_ ,
297+ options = list (pageLength = 3 ,
298+ columnDefs = list (list (className = ' dt-center' , targets = " _all" )))
299+ )
300+ })
301+ dataTableOutput(ns(" x_tmp_table" ))
302+ } else {
303+ output $ x_tmp_table = renderPrint({
304+ # ids_num = nrow()
305+ cat(paste0(" Tip: identifier values of " , nrow(download_data()), " samples are prepared." ))
306+ })
307+ verbatimTextOutput(ns(" x_tmp_table" ))
308+ }
309+ })
310+ }
312311 })
313312
314313 # observeEvent(input$query_data,{
0 commit comments