Skip to content

Commit

Permalink
REMOVE THE UGLY ERROR MESSANGE AND LOAD SHINY CSS LOADER AUTOMATICALLY
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypertyz committed Jul 13, 2020
1 parent 24c84d7 commit d87561b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Imports:
pkgload
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Suggests:
testthat
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(run_app)
import(magrittr)
import(shiny)
importFrom(config,get)
importFrom(golem,activate_js)
Expand Down
6 changes: 3 additions & 3 deletions R/mod_dot_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mod_dot_plot_ui <- function(id){
ns <- NS(id)
tagList(
plotOutput(ns("dot_plot")) %>% withSpinner(color="#ffbd40",
plotOutput(ns("dot_plot")) %>% shinycssloaders::withSpinner(color="#ffbd40",
type = 4,
size = 0.8)
)
Expand All @@ -26,11 +26,11 @@ mod_dot_plot_server <- function(input, output, session, dot_plot_para_ui_1, sele

enrichment_object <- MODifieRDB::enrichment_object_from_db(selected$selected_object, con)

p <- clusterProfiler::dotplot(enrichment_object,
p <- try(clusterProfiler::dotplot(enrichment_object,
x=dot_plot_para_ui_1$xaxis,
showCategory = dot_plot_para_ui_1$showcategory,
color = dot_plot_para_ui_1$color,
title = dot_plot_para_ui_1$plot_title)
title = dot_plot_para_ui_1$plot_title))
return(p)
})

Expand Down
6 changes: 3 additions & 3 deletions R/mod_enrichment_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mod_enrichment_map_ui <- function(id){
ns <- NS(id)
tagList(
plotOutput(ns("enrichment_map")) %>% withSpinner(color= "#ffbd40",
plotOutput(ns("enrichment_map")) %>% shinycssloaders::withSpinner(color= "#ffbd40",
type = 4,
size = 0.8)
)
Expand All @@ -27,11 +27,11 @@ mod_enrichment_map_server <- function(input, output, session, enrichment_map_par

enrichment_object <- MODifieRDB::enrichment_object_from_db(selected$selected_object, con)

p <- enrichplot::emapplot(x = enrichment_object,
p <- try(enrichplot::emapplot(x = enrichment_object,
showCategory = enrichment_map_para_ui_1$showcategory,
color = enrichment_map_para_ui_1$color,
layout = enrichment_map_para_ui_1$layout
) + ggplot2::ggtitle(enrichment_map_para_ui_1$title)
) + ggplot2::ggtitle(enrichment_map_para_ui_1$title))

return(p)
})
Expand Down
6 changes: 3 additions & 3 deletions R/mod_enrichment_results.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mod_enrichment_results_ui <- function(id){
ns <- NS(id)
tagList(
DT::dataTableOutput(ns("enrichment_results")) %>% withSpinner(color="#ffbd40",
DT::dataTableOutput(ns("enrichment_results")) %>% shinycssloaders::withSpinner(color="#ffbd40",
type = 4,
size = 0.8),

Expand All @@ -27,7 +27,7 @@ mod_enrichment_results_server <- function(input, output, session, selected, con)
MODifieRDB::enrichment_object_from_db(selected$selected_object,con)@result[c("Description", "GeneRatio", "BgRatio", "pvalue", "p.adjust", "qvalue", "Count")]
})

output$enrichment_results <- DT::renderDataTable({object()},
output$enrichment_results <- try(DT::renderDataTable({object()},
rownames = FALSE,
filter = "top",
class = 'compact cell-border hover',
Expand All @@ -42,7 +42,7 @@ mod_enrichment_results_server <- function(input, output, session, selected, con)
autoWidth = FALSE,
ordering = TRUE,
dom = "lfrtipB",
buttons = c('copy', 'csv', 'excel')))
buttons = c('copy', 'csv', 'excel'))))
}

## To be copied in the UI
Expand Down
2 changes: 2 additions & 0 deletions R/mod_visual.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' @noRd
#'
#' @importFrom shiny NS tagList
#' @import magrittr
#'
mod_visual_ui <- function(id){
ns <- NS(id)
tagList(
Expand Down

0 comments on commit d87561b

Please sign in to comment.