Skip to content

Commit

Permalink
Merge pull request #359 from massimoaria/develop
Browse files Browse the repository at this point in the history
Minor fix
  • Loading branch information
massimoaria authored Jun 15, 2023
2 parents 6bfaaf4 + 64d1941 commit 6d4136b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 28 deletions.
63 changes: 35 additions & 28 deletions inst/biblioshiny/libraries.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,41 @@
libraries <- function(){
if (!(require(bibliometrix))){install.packages("bibliometrix"); require(bibliometrix)}
#if (!(require(badger, quietly=TRUE))){install.packages("badger"); require(badger, quietly=TRUE)}
if (!(require(shiny, quietly=TRUE))){install.packages("shiny"); require(shiny, quietly=TRUE)}
if (!(require(igraph, quietly=TRUE))){install.packages("igraph"); require(igraph, quietly=TRUE)}
if (!(require(DT, quietly=TRUE))){install.packages("DT")};require(DT, quietly =TRUE)
if (!(require(ggplot2, quietly=TRUE))){install.packages("ggplot2"); require(ggplot2, quietly=TRUE)}
if (!(require(shinycssloaders, quietly=TRUE))){install.packages("shinycssloaders")}
if (!(require(wordcloud2, quietly=TRUE))){install.packages("wordcloud2")}
if (!require(ggmap, quietly=TRUE)){install.packages("ggmap"); require(ggmap, quietly=TRUE)}
if (!require(maps, quietly=TRUE)){install.packages("maps"); require(maps, quietly=TRUE)}
if (!require(visNetwork, quietly=TRUE)){install.packages("visNetwork"); require(visNetwork, quietly=TRUE)}
if (!require(plotly, quietly=TRUE)){install.packages("plotly"); require(plotly, quietly=TRUE)}
if (!require(fontawesome, quietly=TRUE)){install.packages("fontawesome"); require(fontawesome, quietly=TRUE)}
if (!require(shinydashboardPlus, quietly=TRUE)){install.packages("shinydashboardPlus"); require(shinydashboardPlus, quietly=TRUE)}
if (!require(shinydashboard, quietly=TRUE)){install.packages("shinydashboard"); require(shinydashboard, quietly=TRUE)}
if (!require(shinyjs, quietly=TRUE)){install.packages("shinyjs"); require(shinyjs, quietly=TRUE)}
#if (!require(shinyscreenshot, quietly=TRUE)){install.packages("shinyscreenshot"); require(shinyscreenshot, quietly=TRUE)}
if (!require(openxlsx, quietly=TRUE)){install.packages("openxlsx"); require(openxlsx, quietly=TRUE)}
if (!require(shinyWidgets, quietly=TRUE)){install.packages("shinyWidgets"); require(shinyWidgets, quietly=TRUE)}
if (!require(webshot2)){install.packages("webshot2")}
require(Matrix, quietly = TRUE)
require(dimensionsR, quietly = TRUE)
require(pubmedR, quietly = TRUE)
require(dplyr, quietly = TRUE)
require(tidyr, quietly = TRUE)

# packages not automatically downloaded by visNetwork
if (!require(sparkline, quietly=TRUE)){install.packages("sparkline")}#; require(sparkline, quietly=TRUE)}
if (!require(tidygraph, quietly=TRUE)){install.packages("tidygraph")}#; require(tidygraph, quietly=TRUE)}
if (!require(ggraph, quietly=TRUE)){install.packages("ggraph")}#; require(tidygraph, quietly=TRUE)}
suppressPackageStartupMessages({
if (!(require(shiny, quietly=TRUE))){install.packages("shiny"); require(shiny, quietly=TRUE)}
if (!(require(igraph, quietly=TRUE))){install.packages("igraph"); require(igraph, quietly=TRUE)}
if (!(require(DT, quietly=TRUE))){install.packages("DT")};require(DT, quietly =TRUE)
if (!(require(ggplot2, quietly=TRUE))){install.packages("ggplot2"); require(ggplot2, quietly=TRUE)}
if (!(require(shinycssloaders, quietly=TRUE))){install.packages("shinycssloaders")}
if (!(require(wordcloud2, quietly=TRUE))){install.packages("wordcloud2")}
if (!require(ggmap, quietly=TRUE)){install.packages("ggmap"); require(ggmap, quietly=TRUE)}
if (!require(maps, quietly=TRUE)){install.packages("maps"); require(maps, quietly=TRUE)}
if (!require(visNetwork, quietly=TRUE)){install.packages("visNetwork"); require(visNetwork, quietly=TRUE)}
if (!require(plotly, quietly=TRUE)){install.packages("plotly"); require(plotly, quietly=TRUE)}
if (!require(fontawesome, quietly=TRUE)){install.packages("fontawesome"); require(fontawesome, quietly=TRUE)}
if (!require(shinydashboardPlus, quietly=TRUE)){install.packages("shinydashboardPlus"); require(shinydashboardPlus, quietly=TRUE)}
if (!require(shinydashboard, quietly=TRUE)){install.packages("shinydashboard"); require(shinydashboard, quietly=TRUE)}
if (!require(shinyjs, quietly=TRUE)){install.packages("shinyjs"); require(shinyjs, quietly=TRUE)}
#if (!require(shinyscreenshot, quietly=TRUE)){install.packages("shinyscreenshot"); require(shinyscreenshot, quietly=TRUE)}
if (!require(openxlsx, quietly=TRUE)){install.packages("openxlsx"); require(openxlsx, quietly=TRUE)}
if (!require(shinyWidgets, quietly=TRUE)){install.packages("shinyWidgets"); require(shinyWidgets, quietly=TRUE)}
if (!require(webshot2,quietly=TRUE)){install.packages("webshot2")}
if (!(require(chromote, quietly=TRUE))){install.packages("chromote"); require(chromote, quietly=TRUE)}

### workaround for webshot2 on shinyapps.io
if (!(require(curl, quietly=TRUE))){install.packages("curl"); require(curl, quietly=TRUE)}
if (!(require(pagedown, quietly=TRUE))){install.packages("pagedown"); require(pagedown, quietly=TRUE)}
require(Matrix, quietly = TRUE)
require(dimensionsR, quietly = TRUE)
require(pubmedR, quietly = TRUE)
require(dplyr, quietly = TRUE)
require(tidyr, quietly = TRUE)

# packages not automatically downloaded by visNetwork
if (!require(sparkline, quietly=TRUE)){install.packages("sparkline")}#; require(sparkline, quietly=TRUE)}
if (!require(tidygraph, quietly=TRUE)){install.packages("tidygraph")}#; require(tidygraph, quietly=TRUE)}
if (!require(ggraph, quietly=TRUE)){install.packages("ggraph")}#; require(tidygraph, quietly=TRUE)}
})
}

messageItem2 <- function (from, message, icon = shiny::icon("user"), time = NULL,
Expand Down
27 changes: 27 additions & 0 deletions inst/biblioshiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@ server <- function(input, output,session){
## suppress warnings
options(warn = -1)

## chrome configration for shinyapps server
#message(curl::curl_version()) # check curl is installed
if (identical(Sys.getenv("R_CONFIG_ACTIVE"), "shinyapps")) {
chromote::set_default_chromote_object(
chromote::Chromote$new(chromote::Chrome$new(
args = c("--disable-gpu",
"--no-sandbox",
"--disable-dev-shm-usage", # required bc the target easily crashes
c("--force-color-profile", "srgb"))
))
)
}
## end configuration

## Check if Chrome browser is installed on the computer
if(is.null(chromote::find_chrome())){
showModal(modalDialog(
title = strong("Warning message!"),
HTML("Chrome or a Chromium-based browser is not installed on your computer.<br>
If you do not have either of these browsers installed, TALL will be unable to export graphs.<br>
To ensure the functionality of TALL,
please download Chrome by <a href='https://www.google.com/intl/it_it/chrome/' target='_blank' > <b>clicking here</b></a>."),
footer = modalButton("Dismiss"),
easyClose = TRUE
))
}

## file upload max size
maxUploadSize <- 200 # default value
maxUploadSize <- getShinyOption("maxUploadSize", maxUploadSize)
Expand Down

0 comments on commit 6d4136b

Please sign in to comment.