diff --git a/.gitignore b/.gitignore index ea0b30ad..3ce533de 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,14 @@ .txt .bib .Ruserdata +.DS_Store VOSviewer.jar network.net Rubbish desktop.ini vignette.txt inst/doc +inst/biblioshiny/__MACOSX +inst/biblioshiny/rsconnect _gh-pages diff --git a/DESCRIPTION b/DESCRIPTION index 798b2983..ea2cf8c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bibliometrix Type: Package Title: Comprehensive Science Mapping Analysis -Version: 4.0.2 +Version: 4.1.0 Authors@R: c( person(given = "Massimo", family = "Aria", @@ -48,7 +48,7 @@ Imports: stats, shiny, SnowballC, stringdist, - stringr, + stringi, tidyr, tidytext Suggests: @@ -59,6 +59,6 @@ Suggests: shinycssloaders, visNetwork, wordcloud2 -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 NeedsCompilation: no Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 3f856ca8..c1f904ba 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -26,6 +26,7 @@ export(localCitations) export(lotka) export(mergeDbSources) export(metaTagExtraction) +export(missingData) export(net2VOSviewer) export(networkPlot) export(networkStat) @@ -56,6 +57,7 @@ import(readr) import(readxl) import(shiny) import(stats) +import(stringi) import(tidytext) importFrom(DT,DTOutput) importFrom(DT,datatable) @@ -294,9 +296,6 @@ importFrom(rscopus,author_df_orig) importFrom(rscopus,author_search) importFrom(rscopus,get_complete_author_info) importFrom(stringdist,stringdistmatrix) -importFrom(stringr,str_extract_all) -importFrom(stringr,str_locate_all) -importFrom(stringr,str_replace_all) importFrom(tidyr,drop_na) importFrom(tidyr,gather) importFrom(tidyr,pivot_longer) diff --git a/NEWS b/NEWS index f372e1b5..52f50eb8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,17 @@ +bibliometrix v4.0.1 (Release date: 2023-01-13) + +Features: +* Added a new function missingData() to check the completeness of metadata included in a bibliographic data frame +* Biblioshiny: Added the ability to create an excel report by adding step by step results of different analysis +* Biblioshiny: Added a popup that returns the results of the metadata completeness check of imported collections +* Biblioshiny: Revamped interface with floating options menu and more space for graphical analysis results + +Changes: +* Several bug fixes +* Computational speed improvements + + + bibliometrix v4.0.1 (Release date: 2022-09-16) Features: diff --git a/R/bib2df.R b/R/bib2df.R index f21e5888..01e2d47d 100644 --- a/R/bib2df.R +++ b/R/bib2df.R @@ -22,8 +22,10 @@ bib2df<-function(D, dbsource = "isi"){ if (dbsource == "isi") D <- gsub(" = \\{","={",D) + D <- gsub("\\\t","",gsub(" = \\{","=\\{",D)) # to work also with new scopus bib format + D[Papers] <- paste("Paper={",D[Papers],sep="") - #ii <- regexpr("\\{",D[Papers]) + ind <- regexpr("=\\{",D) # sep among tags and contents ind[Papers] <- 6 diff --git a/R/conceptualStructure.R b/R/conceptualStructure.R index df0a8e3c..7ab00136 100644 --- a/R/conceptualStructure.R +++ b/R/conceptualStructure.R @@ -409,36 +409,34 @@ conceptualStructure<-function(M,field="ID", ngrams=1, method="MCA", quali.supp=N b_doc_TC <- b_doc_TC + annotation_custom(logo, xmin = xl[1], xmax = xl[2], ymin = yl[1], ymax = yl[2]) ## - params <- list(field = field, - ngrams = ngrams, - method=method, - quali.supp=quali.supp, - quanti.supp=quanti.supp, - minDegree=minDegree, - clust=clust, - k.max=k.max, - stemming = stemming, - labelsize=labelsize, - documents=documents, - graph=graph, - remove.terms = remove.terms, - synonyms = synonyms) - - params <- data.frame(params=names(unlist(params)),values=unlist(params), row.names = NULL) if (isTRUE(graph)){plot(b_doc_TC)} semanticResults=list(net=CW,res=res.mca,km.res=km.res,graph_terms=b,graph_dendogram=b_dend, - graph_documents_Contrib=b_doc,graph_documents_TC=b_doc_TC,docCoord=docCoord, - params=params) + graph_documents_Contrib=b_doc,graph_documents_TC=b_doc_TC,docCoord=docCoord) }else{ semanticResults=list(net=CW,res=res.mca,km.res=km.res,graph_terms=b,graph_dendogram=b_dend, - graph_documents_Contrib=NULL,graph_documents_TC=NULL,docCoord=NULL, - params=params) + graph_documents_Contrib=NULL,graph_documents_TC=NULL,docCoord=NULL) } + params <- list(field = field, + ngrams = ngrams, + method=method, + quali.supp=quali.supp, + quanti.supp=quanti.supp, + minDegree=minDegree, + clust=clust, + k.max=k.max, + stemming = stemming, + labelsize=labelsize, + documents=documents, + graph=graph, + remove.terms = remove.terms, + synonyms = synonyms) + + semanticResults$params <- data.frame(params=names(unlist(params)),values=unlist(params), row.names = NULL) return(semanticResults) diff --git a/R/couplingMap.R b/R/couplingMap.R index e45eb03f..84f43071 100644 --- a/R/couplingMap.R +++ b/R/couplingMap.R @@ -195,7 +195,22 @@ couplingMap <- function(M, analysis = "documents", field="CR", n=500, label.term row.names(df)=NULL df <- df %>% rename(items = .data$words) - results=list(map=g, clusters=df, data=df_lab,nclust=dim(df)[1], NCS = D, net=Net) + params <- list(analysis = analysis, + field=field, + n=n, + minfreq=minfreq, + label.term=label.term, + ngrams=ngrams, + impact.measure=impact.measure, + stemming=stemming, + n.labels=n.labels, + size=size, + community.repulsion = community.repulsion, + repel=repel, + cluster=cluster) + params <- data.frame(params=names(unlist(params)),values=unlist(params), row.names = NULL) + + results=list(map=g, clusters=df, data=df_lab,nclust=dim(df)[1], NCS = D, net=Net, params=params) return(results) } @@ -315,7 +330,7 @@ labeling <- function(M, df_lab, term, n, n.labels, analysis, ngrams){ #clusters <- unique(df$Cluster) #w <- character(length(clusters)) - + df$SR <- df[,1] tab_global <- tableTag(df, term) tab_global <- data.frame(label=names(tab_global),tot=as.numeric(tab_global), n=nrow(M),stringsAsFactors = FALSE) diff --git a/R/dimensions2df.R b/R/dimensions2df.R index 7f8877c5..6f22a800 100644 --- a/R/dimensions2df.R +++ b/R/dimensions2df.R @@ -76,7 +76,7 @@ dimensions2df <- function(file, format = "csv") { postprocessingDim <- function(DATA) { - DATA <- data.frame(lapply(DATA, toupper), stringsAsFactors = FALSE) + # DATA <- data.frame(lapply(DATA, toupper), stringsAsFactors = FALSE) ## Converting original references in WOS format (AU, PY, SO, VOL, NUM, DOI) if ("Cited.references" %in% names(DATA)) { @@ -232,15 +232,20 @@ postprocessingDim <- function(DATA) { if (("SO" %in% names(DATA)) & ("Anthology.title" %in% names(DATA))) { ind <- which(is.na(DATA$SO) | DATA$SO=="") DATA$SO[ind] <- DATA$Anthology.title[ind] - DATA$SO[DATA$SO==""] <- NA + DATA$SO[is.na(DATA$SO) | DATA$SO==""] <- "NA" } if (!("SO" %in% names(DATA))) { DATA$SO <- "NA" } + #### + cat("\nCreating ISO Source names...") DATA$JI <- sapply(DATA$SO, AbbrevTitle, USE.NAMES = FALSE) DATA$J9 <- gsub("\\.","",DATA$JI) + #### + + DATA <- data.frame(lapply(DATA, toupper), stringsAsFactors = FALSE) DATA$PY <- as.numeric(DATA$PY) diff --git a/R/histNetwork.R b/R/histNetwork.R index bc745e79..a48f299f 100644 --- a/R/histNetwork.R +++ b/R/histNetwork.R @@ -203,8 +203,8 @@ scopus <- function(M, min.citations, sep, network, verbose){ nCum <- c(1, cumsum(n[-length(n)])) CR <- paste(CR, collapse = " ") - L <- str_locate_all(CR, TIpost) - + #L <- str_locate_all(CR, TIpost) + L <- stringi::stri_locate_all_regex(CR,TIpost, omit_no_match = TRUE) LCS <- lengths(L) / 2 diff --git a/R/histPlot.R b/R/histPlot.R index c8675afc..4a966189 100644 --- a/R/histPlot.R +++ b/R/histPlot.R @@ -74,14 +74,14 @@ histPlot<-function(histResults, n=20, size = 5, labelsize = 5, title_as_label = switch(label, title={ - title <- strsplit(stringr::str_to_title(V(bsk.network)$title), " ") + title <- strsplit(stringi::stri_trans_totitle(V(bsk.network)$title), " ") V(bsk.network)$id <- unlist(lapply(title, function(l){ n <- floor(length(l)/2) paste0(paste(l[1:n], collapse=" ", sep=""),"\n",paste(l[(n+1):length(l)], collapse=" ", sep="")) })) }, keywords={ - kw <- strsplit(stringr::str_to_title(V(bsk.network)$keywords), ";") + kw <- strsplit(stringi::stri_trans_totitle(V(bsk.network)$keywords), ";") kw[is.na(kw)] <- "Not Available" V(bsk.network)$id <- unlist(lapply(kw, function(l){ if (length(l)>1){ @@ -92,7 +92,7 @@ histPlot<-function(histResults, n=20, size = 5, labelsize = 5, title_as_label = })) }, keywordsplus={ - kw <- strsplit(stringr::str_to_title(V(bsk.network)$keywordsplus), ";") + kw <- strsplit(stringi::stri_trans_totitle(V(bsk.network)$keywordsplus), ";") kw[is.na(kw)] <- "Not Available" V(bsk.network)$id <- unlist(lapply(kw, function(l){ if (length(l)>1){ @@ -107,24 +107,13 @@ histPlot<-function(histResults, n=20, size = 5, labelsize = 5, title_as_label = } ) - # if (isTRUE(title_as_label)){ - # title <- strsplit(stringr::str_to_title(V(bsk.network)$title), " ") - # V(bsk.network)$id <- unlist(lapply(title, function(l){ - # n <- floor(length(l)/2) - # paste0(paste(l[1:n], collapse=" ", sep=""),"\n",paste(l[(n+1):length(l)], collapse=" ", sep="")) - # })) - # #V(bsk.network)$id <- tolower(paste(substr(V(bsk.network)$title,1,50),"...",sep="")) - # } else { - # V(bsk.network)$id <- tolower(unlist(RR)) - # } - # Compute node degrees (#links) and use that to set node size: deg <- LCS V(bsk.network)$size <- size #rep(size,length(V(bsk.network)))} #Years=histResults$histData$Year[ind] - Years <- as.numeric(unlist(str_extract_all(unlist(RR),"[[:digit:]]{4}$"))) + Years <- as.numeric(unlist(stringi::stri_extract_all_regex(unlist(RR),"[[:digit:]]{4}$"))) V(bsk.network)$years <- Years # Remove loops diff --git a/R/keywordGrowth.R b/R/keywordGrowth.R index 05c3cb74..1c354a1e 100644 --- a/R/keywordGrowth.R +++ b/R/keywordGrowth.R @@ -52,8 +52,8 @@ KeywordGrowth <- function(M, Tag = "ID", sep = ";", top=10, cdf=TRUE, remove.ter A <- A %>% mutate( # Tab = str_replace_all(Tab, paste(sold[[i]], collapse="|",sep=""),snew[i]) - Tab= str_replace_all(Tab, str_replace_all(str_replace_all(paste(sold[[i]], collapse="|",sep=""),"\\(","\\\\("),"\\)","\\\\)"),snew[i]) - + #Tab= str_replace_all(Tab, str_replace_all(str_replace_all(paste(sold[[i]], collapse="|",sep=""),"\\(","\\\\("),"\\)","\\\\)"),snew[i]), + Tab= stringi::stri_replace_all_regex(Tab, stringi::stri_replace_all_regex(stringi::stri_replace_all_regex(paste(sold[[i]], collapse="|",sep=""),"\\(","\\\\("),"\\)","\\\\)"),snew[i]) ) } } diff --git a/R/missingData.R b/R/missingData.R new file mode 100644 index 00000000..501aed62 --- /dev/null +++ b/R/missingData.R @@ -0,0 +1,69 @@ +#' Completeness of bibliographic metadata +#' +#' It calculates the percentage of missing data in the metadata of a bibliographic data frame. +#' +#' Each metadata is assigned a status c("Excellent," "Good," "Acceptable", "Poor", "Critical," "Completely missing") +#' depending on the percentage of missing data. In particular, the column *status* classifies the percentage of missing +#' value in 5 categories: "Excellent" (0%), "Good" (0.01% to 10.00%), "Acceptable" (from 10.01% to 20.00%), +#' "Poor" (from 20.01% to 50.00%), "Critical" (from 50.01% to 99.99%), "Completely missing" (100%). +#' +#' The results of the function allow us to understand which analyses can be performed with bibliometrix +#' and which cannot based on the completeness (or status) of different metadata. +#' @param M is a bibliographic data frame obtained by \code{\link{convert2df}} function. +#' +#' @return The function \code{missingData} returns a list containing two objects: +#' \tabular{lll}{ +#' \code{allTags} \tab \tab is a data frame including results for all original metadata tags from the collection\cr +#' \code{mandatoryTags}\tab \tab is a data frame that included only the tags needed for analysis with bibliometrix and biblioshiny.} +#' +#' @examples +#' data(scientometrics, package = "bibliometrixData") +#' res <- missingData(scientometrics) +#' print(res$mandatoryTags) +#' +#' @export +#' +missingData <- function(M) { + cols <- names(M) + missing_counts <- sapply(cols, function(x){ + sum(is.na(M[,x]) | M[,x] %in% c("NA,0000,NA","NA","")) + }) + missing_pct <- round(missing_counts/nrow(M) * 100, 2) + df_all <- data.frame(cols, missing_counts, missing_pct) + + tag <- unlist( + strsplit( + "AB,AU,C1,CR,DE,DI,DT,ID,LA,NR,PY,RP,SO,TC,TI,WC","," + ) + ) + description <- trimws(unlist( + strsplit( + "Abstract, Author,Affiliation,Cited References,Keywords,DOI,Document Type,Keywords Plus,Language,Number of Cited References, + Publication Year,Corresponding Author, Journal, Total Citation, Title, Science Categories", "," + ) + )) + + df_all <- df_all %>% + mutate(status = status(missing_pct)) %>% + replace_na(replace = list(missing_counts = nrow(M), missing_pct = 100)) + + df_tags <- data.frame(tag, description) %>% + left_join(df_all, by = c("tag" = "cols")) %>% + replace_na(replace = list(missing_counts = nrow(M), missing_pct = 100, status = "Completely missing")) %>% + arrange(missing_pct,description) + + results <- list(allTags=df_all, mandatoryTags=df_tags) + return(results) +} + +status <- function(x){ + y <- character(length(x)) + y[x==0] <- "Excellent" + y[x>0 & x<= 10] <- "Good" + y[x>10 & x<= 20] <- "Acceptable" + y[x>20 & x<=50] <- "Poor" + y[x>50 & x<100] <- "Critical" + y[is.na(x) | x==100] <- "Completely missing" + return(y) +} + diff --git a/R/rpys.R b/R/rpys.R index e4cd3a87..3c941f69 100644 --- a/R/rpys.R +++ b/R/rpys.R @@ -109,7 +109,7 @@ y <- c(min(c(RPYS$Citations,RPYS$diffMedian)),min(c(RPYS$Citations,RPYS$diffMedi g=ggplot(RPYS, aes(x=.data$Year ,y=.data$Citations,text=paste("Year: ",.data$Year,"\nN. of References: ",.data$Citations)))+ geom_line(aes(group="NA")) + - geom_area(aes(group="NA"),fill = 'grey90', alpha = .5) + + #geom_area(aes(group="NA"),fill = 'grey90', alpha = .5) + #geom_hline(aes(yintercept=0, color = 'grey'))+ geom_line(aes(x=.data$Year,y=.data$diffMedian, color="firebrick", group="NA"))+ labs(x = 'Year' diff --git a/R/thematicEvolution.R b/R/thematicEvolution.R index 0648fa7a..98cf38b7 100644 --- a/R/thematicEvolution.R +++ b/R/thematicEvolution.R @@ -11,7 +11,7 @@ #' #' @param M is a bibliographic data frame obtained by the converting function \code{\link{convert2df}}. #' @param field is a character object. It indicates the content field to use. Field can be one of c=("ID","DE","TI","AB"). Default value is \code{field="ID"}. -#' @param years is a numeric vector of two or more unique cut points. +#' @param years is a numeric vector of one or more unique cut points. #' @param n is numerical. It indicates the number of words to use in the network analysis #' @param minFreq is numerical. It indicates the min frequency of words included in to a cluster. #' @param ngrams is an integer between 1 and 4. It indicates the type of n-gram to extract from texts. @@ -57,6 +57,7 @@ thematicEvolution <- function(M, field = "ID", years, n = 250, minFreq = 2, size resk <- thematicMap(Mk, field = field, n = n, minfreq = minFreq, ngrams=ngrams, stemming = stemming, size = size, n.labels = n.labels, repel = repel, remove.terms = remove.terms, synonyms = synonyms, cluster=cluster) + resk$params <- resk$params %>% dplyr::filter(.data$params!="minfreq") res[[k]] <- resk net[[k]] <- resk$net } diff --git a/R/toUpper.R b/R/toUpper.R index 5c9e91b1..6c96564c 100644 --- a/R/toUpper.R +++ b/R/toUpper.R @@ -1,3 +1,3 @@ toUpper <- function(D){ - stringr::str_to_upper(D, locale = "en") + stringi::stri_trans_toupper(D, locale = "en") } \ No newline at end of file diff --git a/R/zzz.R b/R/zzz.R index a506e0dc..b1c881fb 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -13,6 +13,7 @@ #' @import shiny #' @import readr #' @import readxl +#' @import stringi #' @import tidytext #' @importFrom dplyr %>% #' @importFrom dplyr across @@ -255,9 +256,9 @@ #' @importFrom Matrix updown #' @importFrom Matrix which #' @importFrom Matrix writeMM -#' @importFrom stringr str_locate_all -#' @importFrom stringr str_extract_all -#' @importFrom stringr str_replace_all +# #' @importFrom stringr str_locate_all +# #' @importFrom stringr str_extract_all +# #' @importFrom stringr str_replace_all #' @importFrom graphics barplot #' @importFrom graphics legend #' @importFrom graphics lines @@ -536,12 +537,7 @@ StatNodes <- ggplot2::ggproto("StatNodes", ggplot2::Stat, ### Credits to Patrick Barks. Function is a fork of the package Abbrev AbbrevTerm <- function(x, check = TRUE) { - # data("isodata",envir=environment()) - # ltwa_phrase <- ltwa_phrase - # ltwa_prefix <- ltwa_prefix - # ltwa_singles <- ltwa_singles - # df_artcon <- df_artcon - # df_prep <- df_prep + if (check == FALSE) { out <- x } else { @@ -557,37 +553,40 @@ AbbrevTerm <- function(x, check = TRUE) { is_title <- ch1 == toupper(ch1) # check for whole word match - #int_whole_match <- stringi::stri_cmp_equiv(x, ltwa_singles$WORD, strength = 1) - int_whole_match <- identical(x, ltwa_singles$WORD) + # TODO: find way to deal with multiple whole word matches (e.g. w/ and w/o diacritics) + int_whole_match <- stringi::stri_cmp_equiv(x, ltwa_singles$WORD, strength = 1) ind_whole_match <- which(int_whole_match == TRUE) if (length(ind_whole_match > 0)) { + # if whole-word match is found, return corresponding abbrev (if no abbrev, + # return original x) abbrev <- ltwa_singles$ABBREVIATIONS[ind_whole_match] word <- ltwa_singles$WORD[ind_whole_match] out <- ifelse(is.na(abbrev), word, abbrev) } else { # else, find matching prefix - lgl_prefix <- stringr::str_starts(x, ltwa_prefix$WORD) - #lgl_prefix <- stringi::stri_startswith_coll(x, ltwa_prefix$WORD, strength = 1) + # TODO: give preference to matches with higher strength + lgl_prefix <- stringi::stri_startswith_coll(x, ltwa_prefix$WORD, strength = 1) ind_prefix <- which(lgl_prefix == TRUE) # choose abbrev based on number of matching prefixes (0, 1, or 2+) if (length(ind_prefix) == 0) { + # if no matching prefixes, return original x out <- x } else if (length(ind_prefix) == 1) { + # if one matching prefixes, return corresponding abbrev out <- ltwa_prefix$ABBREVIATIONS[ind_prefix] if (is.na(out)) out <- x } else { + # if multiple matching prefixes, choose abbrev from longest match ind_prefix <- ind_prefix[which.max(nchar(ltwa_prefix$WORD[ind_prefix]))] out <- ltwa_prefix$ABBREVIATIONS[ind_prefix] } } # if x contains only latin chars, remove any diacritics from abbrev - if (stringr::str_conv(x, 'Latin-ASCII') == x) { - #if (stringi::stri_trans_general(x, 'Latin-ASCII') == x) { - #out <- stringi::stri_trans_general(out, 'Latin-ASCII') - out <- stringr::str_conv(out, 'Latin-ASCII') + if (stringi::stri_trans_general(x, 'Latin-ASCII') == x) { + out <- stringi::stri_trans_general(out, 'Latin-ASCII') } # if x is title case, convert out to title case @@ -595,18 +594,17 @@ AbbrevTerm <- function(x, check = TRUE) { out <- ToTitleCase(out) } } - + + # return return(out) } + ### Credits to Patrick Barks. Function is a fork of the package Abbrev AbbrevTitle <- function(x) { - # data("isodata",envir=environment()) - # ltwa_phrase <- ltwa_phrase - # ltwa_prefix <- ltwa_prefix - # ltwa_singles <- ltwa_singles - # df_artcon <- df_artcon - # df_prep <- df_prep + ind <- rank(-nchar(ltwa_phrase$WORD), ties.method = "last") + ltwa_phrase[ind,] <- ltwa_phrase + # check for invalid x if(length(x) > 1) { stop('Please provide a single string (length(x) should equal 1)') @@ -616,71 +614,78 @@ AbbrevTitle <- function(x) { # individual words/terms x <- gsub('[[:space:]]\\(.+\\)|\\,|\\.', '', x) xv <- unlist(strsplit(x, ' ')) + + # if title contains only one word, return that word if (length(xv) == 1) { out <- ToTitleCase(xv) } else { + # otherwise... check for matching multi-word phrases + + # vector to track which elements of xv already abbreviated xv_which_abb <- logical(length(xv)) + # search for multi-word matches (e.g. South Pacific) lgl_phrase <- sapply(ltwa_phrase$WORD, function(y) grepl(y, tolower(x)), USE.NAMES = FALSE) ind_phrase <- which(lgl_phrase) + # if any matching multi-word phrases if (length(ind_phrase) > 0) { + for (i in 1:length(ind_phrase)) { match_phrase <- unlist(strsplit(ltwa_phrase$WORD[ind_phrase[i]], '[[:space:]]')) match_abb <- ltwa_phrase$ABBREVIATIONS[ind_phrase[i]] ind_match <- sapply(match_phrase, function(y) grep(y, tolower(xv)), USE.NAMES = FALSE) # should only find sequential matches - xv[ind_match[1]] <- match_abb - xv_which_abb[ind_match[1]] <- TRUE - xv <- xv[-ind_match[-1]] - xv_which_abb <- xv_which_abb[-ind_match[-1]] + if (length(ind_match[[1]])>0){ + ind <- ind_match[[1]]:(ind_match[[1]]+length(ind_match)-1) + xv[ind[1]] <- match_abb + xv <- c(xv[-ind[-1]]) + xv_which_abb[ind[1]] <- TRUE + xv_which_abb <- c(xv_which_abb[-ind[-1]]) + } } } - + + # if title fully matches multi-word phrase(s), return if (all(xv_which_abb == TRUE)) { out <- xv } else { - - CheckPrep <- function(x, check) { - if(check == TRUE) { - return(ifelse(tolower(x) %in% df_prep$word, TRUE, FALSE)) - } else { - return(FALSE) - } - } + # otherwise... deal with prepositions, articles, and conjunctions + # remove prepositions not at beginning of word ind_rem_prep <- c(FALSE, mapply(CheckPrep, USE.NAMES = F, x = xv[-1], check = !xv_which_abb[-1])) xv <- xv[!ind_rem_prep] xv_which_abb <- xv_which_abb[!ind_rem_prep] - CheckArtCon <- function(x, check) { - if(check == TRUE) { - return(ifelse(tolower(x) %in% df_artcon$word, TRUE, FALSE)) - } else { - return(FALSE) - } - } - + # remove articles and conjunctions ind_rem_artcon <- mapply(CheckArtCon, USE.NAMES = F, x = xv, check = !xv_which_abb) xv <- xv[!ind_rem_artcon] xv_which_abb <- xv_which_abb[!ind_rem_artcon] + # remove d' and l', if followed by character xv <- gsub("^d'(?=[[:alpha:]])|^l'(?=[[:alpha:]])", "", xv, ignore.case = TRUE, perl = TRUE) + # if title fully matches multi-word phrase(s) (minus articles/conjunctions), return if (all(xv_which_abb == TRUE)) { out <- xv } else { - + # otherwise... check for hyphenated words + + # check for hyphenated words ind_dash <- grep('[[:alpha:]]-[[:alpha:]]', xv) if (length(ind_dash) > 0) { + # if hyphens, split hyphenated strings into vectors xv <- unlist(strsplit(xv, '-')) + # update xv_which_abb based on hyphens for(i in length(ind_dash):1) { xv_which_abb <- append(xv_which_abb, FALSE, ind_dash[i]) } } + # abbreviate all words in title (excluding multi-word phrases) abbrev_full <- mapply(AbbrevTerm, x = xv, check = !xv_which_abb, USE.NAMES = F) + # add dashes back in, if applicable if (length(ind_dash) > 0) { for(i in 1:length(ind_dash)) { dashed_terms <- abbrev_full[c(ind_dash[i], ind_dash[i] + 1)] @@ -689,6 +694,7 @@ AbbrevTitle <- function(x) { } } + # collapse title to vector out <- paste(abbrev_full, collapse = ' ') } } @@ -700,3 +706,18 @@ ToTitleCase <- function(x) { paste0(toupper(substr(x, 1, 1)), substr(x, 2, nchar(x))) } +CheckPrep <- function(x, check) { + if(check == TRUE) { + return(ifelse(tolower(x) %in% df_prep$word, TRUE, FALSE)) + } else { + return(FALSE) + } +} + +CheckArtCon <- function(x, check) { + if(check == TRUE) { + return(ifelse(tolower(x) %in% df_artcon$word, TRUE, FALSE)) + } else { + return(FALSE) + } +} diff --git a/README.Rmd b/README.Rmd index 9bc7630c..e23a52bd 100644 --- a/README.Rmd +++ b/README.Rmd @@ -82,7 +82,7 @@ It supports scholars in easy use of the main features of bibliometrix: ### How to use biblioshiny -Please follow the biblioshiny tutorial at www.bibliometrix.org/biblioshiny +Please follow the biblioshiny tutorial at the section tutorial of bibliometrix website https://www.bibliometrix.org/ ## How to cite bibliometrix @@ -102,10 +102,12 @@ CRAN page: https://cran.r-project.org/package=bibliometrix GitHub repository: https://github.com/massimoaria/bibliometrix -Tutorial: https://www.bibliometrix.org/vignettes/Introduction_to_bibliometrix.html +Tutorials -Slides: https://www.slideshare.net/MassimoAria/bibliometrix-phd-seminar +How to use: https://www.bibliometrix.org/vignettes/Introduction_to_bibliometrix.html +Data importing +and converting: https://www.bibliometrix.org/vignettes/Data-Importing-and-Converting.html @@ -123,8 +125,8 @@ Developers version from GitHub ```{r eval=FALSE, include=FALSE} -install.packages("devtools") -devtools::install_github("massimoaria/bibliometrix") +install.packages("remotes") +remotes::install_github("massimoaria/bibliometrix") ``` Load `bibliometrix` @@ -163,6 +165,25 @@ Each manuscript contains several elements, such as authors' names, title, keywor Data frame columns are named using the standard Clarivate Analytics WoS Field Tag codify [(https://www.bibliometrix.org/documents/Field_Tags_bibliometrix.pdf)](https://www.bibliometrix.org/documents/Field_Tags_bibliometrix.pdf). +## Check completeness of metadata included in the bibliographic data frame + +After importing a bibliographic data frame, we can check the completeness of the metadata included in it through **missingData()**. + +**missingData**(*M*) + +The argument *M* is a bibliographic data frame obtained by **convert2df** function. + +```{r Completeness of metadata} +## An example from bibliometrix vignettes + +com <- missingData(M) + +com$mandatoryTags +``` + +**missingData** returns a list containing two data frame. The first one, *allTags* includes the results for all metadata in M. The latter, *mandatoryTags*, reports the results only for the metadata needed to perform analyses with bibliometrix or biblioshiny. + +The column *status* classifies the percentage of missing value in 5 categories: "Excellent" (0%), "Good" (0.01% to 10.00%), "Acceptable" (from 10.01% to 20.00%), "Poor" (from 20.01% to 50.00%), "Critical" (from 50.01% to 99.99%), "Completely missing" (100%). ## Bibliometric Analysis @@ -331,16 +352,29 @@ net <- histPlot(histResults, n=20, size = FALSE,label="short") ## Main Authors' references (about bibliometrics) -Aria, M. & Cuccurullo, C. (2017). *bibliometrix*: An R-tool for comprehensive science mapping - analysis, *Journal of Informetrics*, 11(4), pp 959-975, Elsevier, DOI: 10.1016/j.joi.2017.08.007 (https://doi.org/10.1016/j.joi.2017.08.007). -Cuccurullo, C., Aria, M., & Sarto, F. (2016). Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains, *Scientometrics*, DOI: 10.1007/s11192-016-1948-8 (https://doi.org/10.1007/s11192-016-1948-8). +Aria, M. & Cuccurullo, C. (2017). bibliometrix: An R-tool for comprehensive science mapping analysis, *Journal of Informetrics*, 11(4), pp 959-975, Elsevier, DOI: 10.1016/j.joi.2017.08.007 (https://doi.org/10.1016/j.joi.2017.08.007) + +Aria, M., Cuccurullo, C., D’Aniello, L., Misuraca, M., & Spano, M. (2022). Thematic Analysis as a New Culturomic Tool: The Social Media Coverage on COVID-19 Pandemic in Italy. *Sustainability*, 14(6), 3643, (https://doi.org/10.3390/su14063643) + +Belfiore, A., Salatino, A., & Osborne, F. (2022). Characterising Research Areas in the field of AI. *arXiv preprint arXiv:2205.13471*.(https://doi.org/10.48550/arXiv.2205.13471) + +Belfiore, A., Cuccurullo, C., & Aria, M. (2022). IoT in healthcare: A scientometric analysis. *Technological Forecasting and Social Change*, 184, 122001. (https://doi.org/10.1016/j.techfore.2022.122001) + +D'Aniello, L., Spano, M., Cuccurullo, C., & Aria, M. (2022). Academic Health Centers’ configurations, scientific productivity, and impact: insights from the Italian setting. *Health Policy*. (https://doi.org/10.1016/j.healthpol.2022.09.007) + +Aria M., Misuraca M., Spano M. (2020) Mapping the evolution of social research and data science on 30 years of Social Indicators Research, *Social Indicators Research*. (DOI: https://doi.org/10.1007/s11205-020-02281-3) + +Aria M., Alterisio A., Scandurra A, Pinelli C., D’Aniello B, (2021) The scholar’s best friend: research trends in dog cognitive and behavioural studies, A*nimal Cognition*. (https://doi.org/10.1007/s10071-020-01448-2) + +Cuccurullo, C., Aria, M., & Sarto, F. (2016). Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains, *Scientometrics*, DOI: 10.1007/s11192-016-1948-8 (https://doi.org/10.1007/s11192-016-1948-8) + +Cuccurullo, C., Aria, M., & Sarto, F. (2015). Twenty years of research on performance management in business and public administration domains. Presentation at the *Correspondence Analysis and Related Methods conference (CARME 2015)* in September 2015 (https://www.bibliometrix.org/documents/2015Carme_cuccurulloetal.pdf) +Sarto, F., Cuccurullo, C., & Aria, M. (2014). Exploring healthcare governance literature: systematic review and paths for future research. *Mecosan* (https://www.francoangeli.it/Riviste/Scheda_Rivista.aspx?IDarticolo=52780&lingua=en) -Cuccurullo, C., Aria, M., & Sarto, F. (2015). Twenty years of research on performance management in business and public administration domains. Presentation at the *Correspondence Analysis and Related Methods conference (CARME 2015)* in September 2015 (https://www.bibliometrix.org/documents/2015Carme_cuccurulloetal.pdf). +Cuccurullo, C., Aria, M., & Sarto, F. (2013). Twenty years of research on performance management in business and public administration domains. In *Academy of Management Proceedings* (Vol. 2013, No. 1, p. 14270). Academy of Management (https://doi.org/10.5465/AMBPP.2013.14270abstract) -Sarto, F., Cuccurullo, C., & Aria, M. (2014). Exploring healthcare governance literature: systematic review and paths for future research. *Mecosan* (https://www.francoangeli.it/Riviste/Scheda_Rivista.aspx?IDarticolo=52780&lingua=en). -Cuccurullo, C., Aria, M., & Sarto, F. (2013). Twenty years of research on performance management in business and public administration domains. In *Academy of Management Proceedings* (Vol. 2013, No. 1, p. 14270). Academy of Management (https://doi.org/10.5465/AMBPP.2013.14270abstract). diff --git a/README.md b/README.md index 191acbcb..442c828d 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,8 @@ It supports scholars in easy use of the main features of bibliometrix: ### How to use biblioshiny -Please follow the biblioshiny tutorial at -www.bibliometrix.org/biblioshiny +Please follow the biblioshiny tutorial at the section tutorial of +bibliometrix website ## How to cite bibliometrix @@ -102,11 +102,13 @@ CRAN page: GitHub repository: -Tutorial: +Tutorials + +How to use: -Slides: - +Data importing and converting: + ## Installation @@ -179,6 +181,51 @@ Data frame columns are named using the standard Clarivate Analytics WoS Field Tag codify [(https://www.bibliometrix.org/documents/Field_Tags_bibliometrix.pdf)](https://www.bibliometrix.org/documents/Field_Tags_bibliometrix.pdf). +## Check completeness of metadata included in the bibliographic data frame + +After importing a bibliographic data frame, we can check the +completeness of the metadata included in it through **missingData()**. + +**missingData**(*M*) + +The argument *M* is a bibliographic data frame obtained by +**convert2df** function. + +``` r +## An example from bibliometrix vignettes + +com <- missingData(M) + +com$mandatoryTags +#> tag description missing_counts missing_pct status +#> 1 AU Author 0 0.00 Excellent +#> 2 DT Document Type 0 0.00 Excellent +#> 3 SO Journal 0 0.00 Excellent +#> 4 LA Language 0 0.00 Excellent +#> 5 NR Number of Cited References 0 0.00 Excellent +#> 6 WC Science Categories 0 0.00 Excellent +#> 7 TI Title 0 0.00 Excellent +#> 8 TC Total Citation 0 0.00 Excellent +#> 9 CR Cited References 2 0.22 Good +#> 10 AB Abstract 7 0.78 Good +#> 11 PY Publication Year 9 1.00 Good +#> 12 RP Corresponding Author 10 1.11 Good +#> 13 C1 Affiliation 21 2.34 Good +#> 14 DI DOI 36 4.01 Good +#> 15 DE Keywords 79 8.80 Good +#> 16 ID Keywords Plus 97 10.80 Acceptable +``` + +**missingData** returns a list containing two data frame. The first one, +*allTags* includes the results for all metadata in M. The latter, +*mandatoryTags*, reports the results only for the metadata needed to +perform analyses with bibliometrix or biblioshiny. + +The column *status* classifies the percentage of missing value in 5 +categories: “Excellent” (0%), “Good” (0.01% to 10.00%), “Acceptable” +(from 10.01% to 20.00%), “Poor” (from 20.01% to 50.00%), “Critical” +(from 50.01% to 99.99%), “Completely missing” (100%). + ## Bibliometric Analysis The first step is to perform a descriptive analysis of the bibliographic @@ -216,9 +263,9 @@ S <- summary(object = results, k = 10, pause = FALSE) #> Sources (Journals, Books, etc) 281 #> Documents 898 #> Annual Growth Rate % 0 -#> Document Average Age 7.19 +#> Document Average Age 8.19 #> Average citations per doc 37.12 -#> Average citations per year per doc 4.609 +#> Average citations per year per doc 3.926 #> References 43935 #> #> DOCUMENT TYPES @@ -303,16 +350,16 @@ S <- summary(object = results, k = 10, pause = FALSE) #> Top manuscripts per citations #> #> Paper DOI TC TCperYear NTC -#> 1 CHEN HC, 2012, MIS QUART NA 2161 196.45 15.64 -#> 2 ZUPIC I, 2015, ORGAN RES METHODS 10.1177/1094428114562629 844 105.50 17.17 -#> 3 RAMOS-RODRIGUEZ AR, 2004, STRATEGIC MANAGE J 10.1002/smj.397 667 35.11 3.76 -#> 4 VOLBERDA HW, 2010, ORGAN SCI 10.1287/orsc.1090.0503 626 48.15 9.82 -#> 5 DAIM TU, 2006, TECHNOL FORECAST SOC 10.1016/j.techfore.2006.04.004 569 33.47 5.67 -#> 6 KOSTOFF RN, 2001, IEEE T ENG MANAGE 10.1109/17.922473 387 17.59 2.66 -#> 7 NERUR SP, 2008, STRATEG MANAGE J 10.1002/smj.659 353 23.53 3.48 -#> 8 MELIN G, 2000, RES POLICY 10.1016/S0048-7333(99)00031-1 336 14.61 2.15 -#> 9 MOED HF, 1985, RES POLICY 10.1016/0048-7333(85)90012-5 310 8.16 1.81 -#> 10 MURRAY F, 2002, RES POLICY 10.1016/S0048-7333(02)00070-7 301 14.33 2.40 +#> 1 CHEN HC, 2012, MIS QUART NA 2161 180.08 15.64 +#> 2 ZUPIC I, 2015, ORGAN RES METHODS 10.1177/1094428114562629 844 93.78 17.17 +#> 3 RAMOS-RODRIGUEZ AR, 2004, STRATEGIC MANAGE J 10.1002/smj.397 667 33.35 3.76 +#> 4 VOLBERDA HW, 2010, ORGAN SCI 10.1287/orsc.1090.0503 626 44.71 9.82 +#> 5 DAIM TU, 2006, TECHNOL FORECAST SOC 10.1016/j.techfore.2006.04.004 569 31.61 5.67 +#> 6 KOSTOFF RN, 2001, IEEE T ENG MANAGE 10.1109/17.922473 387 16.83 2.66 +#> 7 NERUR SP, 2008, STRATEG MANAGE J 10.1002/smj.659 353 22.06 3.48 +#> 8 MELIN G, 2000, RES POLICY 10.1016/S0048-7333(99)00031-1 336 14.00 2.15 +#> 9 MOED HF, 1985, RES POLICY 10.1016/0048-7333(85)90012-5 310 7.95 1.81 +#> 10 MURRAY F, 2002, RES POLICY 10.1016/S0048-7333(02)00070-7 301 13.68 2.40 #> #> #> Corresponding Author's Countries @@ -630,29 +677,57 @@ net <- histPlot(histResults, n=20, size = FALSE,label="short") ## Main Authors’ references (about bibliometrics) -Aria, M. & Cuccurullo, C. (2017). *bibliometrix*: An R-tool for +Aria, M. & Cuccurullo, C. (2017). bibliometrix: An R-tool for comprehensive science mapping analysis, *Journal of Informetrics*, 11(4), pp 959-975, Elsevier, DOI: 10.1016/j.joi.2017.08.007 -(). +() + +Aria, M., Cuccurullo, C., D’Aniello, L., Misuraca, M., & Spano, M. +(2022). Thematic Analysis as a New Culturomic Tool: The Social Media +Coverage on COVID-19 Pandemic in Italy. *Sustainability*, 14(6), 3643, +() + +Belfiore, A., Salatino, A., & Osborne, F. (2022). Characterising +Research Areas in the field of AI. *arXiv preprint +arXiv:2205.13471*.() + +Belfiore, A., Cuccurullo, C., & Aria, M. (2022). IoT in healthcare: A +scientometric analysis. *Technological Forecasting and Social Change*, +184, 122001. () + +D’Aniello, L., Spano, M., Cuccurullo, C., & Aria, M. (2022). Academic +Health Centers’ configurations, scientific productivity, and impact: +insights from the Italian setting. *Health Policy*. +() + +Aria M., Misuraca M., Spano M. (2020) Mapping the evolution of social +research and data science on 30 years of Social Indicators Research, +*Social Indicators Research*. (DOI: +) + +Aria M., Alterisio A., Scandurra A, Pinelli C., D’Aniello B, (2021) The +scholar’s best friend: research trends in dog cognitive and behavioural +studies, A*nimal Cognition*. +() Cuccurullo, C., Aria, M., & Sarto, F. (2016). Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains, *Scientometrics*, DOI: -10.1007/s11192-016-1948-8 (). +10.1007/s11192-016-1948-8 () Cuccurullo, C., Aria, M., & Sarto, F. (2015). Twenty years of research on performance management in business and public administration domains. Presentation at the *Correspondence Analysis and Related Methods conference (CARME 2015)* in September 2015 -(). +() Sarto, F., Cuccurullo, C., & Aria, M. (2014). Exploring healthcare governance literature: systematic review and paths for future research. *Mecosan* -(). +() Cuccurullo, C., Aria, M., & Sarto, F. (2013). Twenty years of research on performance management in business and public administration domains. In *Academy of Management Proceedings* (Vol. 2013, No. 1, p. 14270). Academy of Management -(). +() diff --git a/data/customTheme.rda b/data/customTheme.rda index 91215ab0..34fb737c 100644 Binary files a/data/customTheme.rda and b/data/customTheme.rda differ diff --git a/inst/biblioshiny/libraries.R b/inst/biblioshiny/libraries.R index 8940f21d..5ffb845c 100644 --- a/inst/biblioshiny/libraries.R +++ b/inst/biblioshiny/libraries.R @@ -25,4 +25,13 @@ libraries <- function(){ require(pubmedR, quietly = TRUE) require(dplyr, quietly = TRUE) require(tidyr, quietly = TRUE) +} + +messageItem2 <- function (from, message, icon = shiny::icon("user"), time = NULL, + href = NULL, inputId = NULL){ + if (is.null(href)) + href <- "#" + shiny::tags$li(shiny::a(id = inputId, class = if (!is.null(inputId)) + "action-button", href = href, target = "_blank", icon, shiny::h4(from, if (!is.null(time)) + shiny::tags$small(shiny::icon("clock-o"), time)), shiny::p(message))) } \ No newline at end of file diff --git a/inst/biblioshiny/server.R b/inst/biblioshiny/server.R index 4cb179e3..8909e19f 100644 --- a/inst/biblioshiny/server.R +++ b/inst/biblioshiny/server.R @@ -16,14 +16,21 @@ server <- function(input, output,session){ data("logo",package="bibliometrix",envir=environment()) values = reactiveValues() values$sidebar <- sidebarMenu() + values$rest_sidebar <- FALSE values$list_file <- data.frame(sheet=NULL,file=NULL,n=NULL) values$wb <- openxlsx::createWorkbook() values$dfLabel <- dfLabel() values$myChoices <- "Empty Report" values$logo <- logo values$logoGrid <- grid::rasterGrob(logo,interpolate = TRUE) + + ### setting values + values$dpi <- 300 values$h <- 7 - values$w <- 14 + #values$w <- 14 + values$path <- paste(getwd(),"/", sep="") + ### + values$results <- list("NA") values$log <- "working..." values$load="FALSE" @@ -104,67 +111,68 @@ server <- function(input, output,session){ ## SIDEBAR MENU ---- ### Apply Data---- output$rest_of_sidebar <- renderMenu({ - if (ncol(values$M)>1){ - sidebarMenu( - menuItem("Filters",tabName = "filters",icon = fa_i(name ="filter")), - menuItem("Overview",tabName = "overview",icon=fa_i(name = "table"),startExpanded = FALSE, - menuSubItem("Main Information",tabName="mainInfo",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Annual Scientific Production",tabName = "annualScPr",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Average Citations per Year",tabName = "averageCitPerYear",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Three-Field Plot", tabName ="threeFieldPlot",icon = icon("chevron-right",lib = "glyphicon"))), - menuItem("Sources", tabName = "sources",icon = fa_i(name ="book"), startExpanded = FALSE, - menuSubItem("Most Relevant Sources", tabName = "relevantSources",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Most Local Cited Sources",tabName = "localCitedSources",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Bradford's Law",tabName = "bradford",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Sources' Local Impact",tabName = "sourceImpact",icon = icon("chevron-right",lib = "glyphicon")), - menuSubItem("Sources' Production over Time",tabName = "sourceDynamics",icon = icon("chevron-right",lib = "glyphicon"))), - menuItem("Authors", tabName = "authors",icon = fa_i(name="user"),startExpanded = FALSE, - "Authors", - menuSubItem("Most Relevant Authors", tabName = "mostRelAuthors",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Most Local Cited Authors",tabName = "mostLocalCitedAuthors",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Authors' Production over Time",tabName = "authorsProdOverTime",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Lotka's Law",tabName = "lotka",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Authors' Local Impact",tabName = "authorImpact",icon = icon("chevron-right", lib = "glyphicon")), - "Affiliations", - menuSubItem("Most Relevant Affiliations",tabName = "mostRelAffiliations",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Affiliations' Production over Time",tabName = "AffOverTime",icon = icon("chevron-right", lib = "glyphicon")), - "Countries", - menuSubItem("Corresponding Author's Countries",tabName = "correspAuthorCountry",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Countries' Scientific Production",tabName = "countryScientProd",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Countries' Production over Time",tabName = "COOverTime",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Most Cited Countries",tabName = "mostCitedCountries",icon = icon("chevron-right", lib = "glyphicon")) - ), - menuItem("Documents", tabName = "documents",icon = fa_i(name="layer-group"), startExpanded = FALSE, - "Documents", - menuSubItem("Most Global Cited Documents",tabName = "mostGlobalCitDoc",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Most Local Cited Documents",tabName = "mostLocalCitDoc",icon = icon("chevron-right", lib = "glyphicon")), - "Cited References", - menuSubItem("Most Local Cited References",tabName = "mostLocalCitRef",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("References Spectroscopy",tabName = "ReferenceSpect",icon = icon("chevron-right", lib = "glyphicon")), - "Words", - menuSubItem("Most Frequent Words",tabName = "mostFreqWords",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("WordCloud", tabName = "wcloud",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("TreeMap",tabName = "treemap",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Words' Frequency over Time",tabName = "wordDynamics",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Trend Topics",tabName = "trendTopic",icon = icon("chevron-right", lib = "glyphicon")) - ), - menuItem("Clustering", tabName = "clustering",icon = fa_i(name ="spinner"),startExpanded = FALSE, - menuSubItem("Clustering by Coupling",tabName = "coupling",icon = icon("chevron-right", lib = "glyphicon"))), - menuItem("Conceptual Structure",tabName = "concepStructure",icon = fa_i(name="spell-check"),startExpanded = FALSE, - "Network Approach", - menuSubItem("Co-occurence Network",tabName = "coOccurenceNetwork",icon = icon("chevron-right", lib = "glyphicon") ), - menuSubItem("Thematic Map",tabName = "thematicMap", icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Thematic Evolution",tabName = "thematicEvolution", icon = icon("chevron-right", lib = "glyphicon")), - "Factorial Approach", - menuSubItem("Factorial Analysis", tabName = "factorialAnalysis", icon = icon("chevron-right", lib = "glyphicon"))), - menuItem("Intellectual Structure",tabName = "intStruct",icon = fa_i(name="gem"), startExpanded = FALSE, - menuSubItem("Co-citation Network",tabName = "coCitationNetwork", icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Historiograph",tabName = "historiograph", icon = icon("chevron-right", lib = "glyphicon"))), - menuItem("Social Structure",tabName = "socialStruct", icon = fa_i("users"),startExpanded = FALSE, - menuSubItem("Collaboration Network",tabName = "collabNetwork",icon = icon("chevron-right", lib = "glyphicon")), - menuSubItem("Countries' Collaboration World Map", tabName = "collabWorldMap",icon = icon("chevron-right", lib = "glyphicon"))), - menuItem("Report",tabName = "report",icon = fa_i(name ="list-alt")) - ) + if (isTRUE(values$rest_sidebar)){ + sidebarMenu( + menuItem("Filters",tabName = "filters",icon = fa_i(name ="filter")), + menuItem("Overview",tabName = "overview",icon=fa_i(name = "table"),startExpanded = FALSE, + menuSubItem("Main Information",tabName="mainInfo",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Annual Scientific Production",tabName = "annualScPr",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Average Citations per Year",tabName = "averageCitPerYear",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Three-Field Plot", tabName ="threeFieldPlot",icon = icon("chevron-right",lib = "glyphicon"))), + menuItem("Sources", tabName = "sources",icon = fa_i(name ="book"), startExpanded = FALSE, + menuSubItem("Most Relevant Sources", tabName = "relevantSources",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Most Local Cited Sources",tabName = "localCitedSources",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Bradford's Law",tabName = "bradford",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Sources' Local Impact",tabName = "sourceImpact",icon = icon("chevron-right",lib = "glyphicon")), + menuSubItem("Sources' Production over Time",tabName = "sourceDynamics",icon = icon("chevron-right",lib = "glyphicon"))), + menuItem("Authors", tabName = "authors",icon = fa_i(name="user"),startExpanded = FALSE, + "Authors", + menuSubItem("Most Relevant Authors", tabName = "mostRelAuthors",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Most Local Cited Authors",tabName = "mostLocalCitedAuthors",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Authors' Production over Time",tabName = "authorsProdOverTime",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Lotka's Law",tabName = "lotka",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Authors' Local Impact",tabName = "authorImpact",icon = icon("chevron-right", lib = "glyphicon")), + "Affiliations", + menuSubItem("Most Relevant Affiliations",tabName = "mostRelAffiliations",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Affiliations' Production over Time",tabName = "AffOverTime",icon = icon("chevron-right", lib = "glyphicon")), + "Countries", + menuSubItem("Corresponding Author's Countries",tabName = "correspAuthorCountry",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Countries' Scientific Production",tabName = "countryScientProd",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Countries' Production over Time",tabName = "COOverTime",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Most Cited Countries",tabName = "mostCitedCountries",icon = icon("chevron-right", lib = "glyphicon")) + ), + menuItem("Documents", tabName = "documents",icon = fa_i(name="layer-group"), startExpanded = FALSE, + "Documents", + menuSubItem("Most Global Cited Documents",tabName = "mostGlobalCitDoc",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Most Local Cited Documents",tabName = "mostLocalCitDoc",icon = icon("chevron-right", lib = "glyphicon")), + "Cited References", + menuSubItem("Most Local Cited References",tabName = "mostLocalCitRef",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("References Spectroscopy",tabName = "ReferenceSpect",icon = icon("chevron-right", lib = "glyphicon")), + "Words", + menuSubItem("Most Frequent Words",tabName = "mostFreqWords",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("WordCloud", tabName = "wcloud",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("TreeMap",tabName = "treemap",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Words' Frequency over Time",tabName = "wordDynamics",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Trend Topics",tabName = "trendTopic",icon = icon("chevron-right", lib = "glyphicon")) + ), + menuItem("Clustering", tabName = "clustering",icon = fa_i(name ="spinner"),startExpanded = FALSE, + menuSubItem("Clustering by Coupling",tabName = "coupling",icon = icon("chevron-right", lib = "glyphicon"))), + menuItem("Conceptual Structure",tabName = "concepStructure",icon = fa_i(name="spell-check"),startExpanded = FALSE, + "Network Approach", + menuSubItem("Co-occurence Network",tabName = "coOccurenceNetwork",icon = icon("chevron-right", lib = "glyphicon") ), + menuSubItem("Thematic Map",tabName = "thematicMap", icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Thematic Evolution",tabName = "thematicEvolution", icon = icon("chevron-right", lib = "glyphicon")), + "Factorial Approach", + menuSubItem("Factorial Analysis", tabName = "factorialAnalysis", icon = icon("chevron-right", lib = "glyphicon"))), + menuItem("Intellectual Structure",tabName = "intStruct",icon = fa_i(name="gem"), startExpanded = FALSE, + menuSubItem("Co-citation Network",tabName = "coCitationNetwork", icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Historiograph",tabName = "historiograph", icon = icon("chevron-right", lib = "glyphicon"))), + menuItem("Social Structure",tabName = "socialStruct", icon = fa_i("users"),startExpanded = FALSE, + menuSubItem("Collaboration Network",tabName = "collabNetwork",icon = icon("chevron-right", lib = "glyphicon")), + menuSubItem("Countries' Collaboration World Map", tabName = "collabWorldMap",icon = icon("chevron-right", lib = "glyphicon"))), + menuItem("Report",tabName = "report",icon = fa_i(name ="list-alt")), + menuItem("Settings",tabName = "settings",icon = fa_i(name ="sliders")) + ) } else { sidebarMenu() } @@ -234,6 +242,8 @@ server <- function(input, output,session){ values$Morig = management values$Histfield = "NA" values$results = list("NA") + values$rest_sidebar <- TRUE + #showModal(missingModal(session)) return() } inFile <- input$file1 @@ -448,8 +458,10 @@ server <- function(input, output,session){ values$Morig = M values$Histfield = "NA" values$results = list("NA") - + if (ncol(values$M)>1){values$rest_sidebar <- TRUE} + if (ncol(values$M)>1){showModal(missingModal(session))} }) + output$contents <- DT::renderDT({ DATAloading() MData = as.data.frame(apply(values$M, 2, function(x) { @@ -467,7 +479,8 @@ server <- function(input, output,session){ MData = MData[nome] DT::datatable(MData,escape = FALSE,rownames = FALSE, extensions = c("Buttons"), options = list( - pageLength = 5, + pageLength = 3, + autoWidth = FALSE, scrollX = TRUE, dom = 'Bfrtip', buttons = list(list(extend = 'pageLength'), list(extend = 'print')), @@ -487,6 +500,115 @@ server <- function(input, output,session){ ) }) + ### Missing Data in Metadata ---- + output$missingDataTable <- DT::renderDT({ + values$missingdf <- df <- missingData(values$M)$mandatoryTags + + names(df) <- c("Metadata", "Description", "Missing Counts", "Missing %", "Status") + DT::datatable(df,escape = FALSE,rownames = FALSE, #extensions = c("Buttons"), + class = 'cell-border stripe', + selection = 'none', + options = list( + pageLength = nrow(df), + info = FALSE, + autoWidth = FALSE, scrollX = TRUE, + dom = 'rti', + ordering=F, + columnDefs = list( + list( + targets = ncol(df)-1, + createdCell = JS( + "function(td, cellData, rowData, row, col) {", + " if (cellData === 'Completely missing') {", + " $(td).css('background-color', '#b22222');", + " } else if (cellData === 'Critical') {", + " $(td).css('background-color', '#f08080');", + " } else if (cellData === 'Poor') {", + " $(td).css('background-color', 'lightgrey');", + " } else if (cellData === 'Acceptable') {", + " $(td).css('background-color', '#f0e68c');", + " } else if (cellData === 'Good') {", + " $(td).css('background-color', '#90ee90');", + " } else if (cellData === 'Excellent') {", + " $(td).css('background-color', '#32cd32');", + " }", + "}") + ) + ) + ) + ) %>% + formatRound("Missing %", digits=2) %>% + formatStyle( + "Status", + textAlign = 'center' + ) + # ) %>% + # formatStyle( + # "Missing %", + # background = styleColorBar(df[,4], '#b22222') + # ) + + }) + + observeEvent(input$missingMessage,{ + tag <- values$missingdf$description[values$missingdf$status %in% c("Critical", "Completely missing")] + if (length(tag)>0){ + text <- paste("Analyses that require the following information:

",paste("- ","",tag,"","
", collapse=""), + "
cannot be performed!",collapse="") + type <- "warning" + }else{ + text <- "Your metadata have no critical issues" + type <- "success" + } + + show_alert( + title = NULL, + #text = HTML(paste("Analyses that require the following information:
",paste("- ",tag,"
", collapse=""),"cannot be performed!",collapse="")), + text =tagList( + div( + h4(HTML(text)), + style="text-align:left") + ), + type = type, + size = "s", + closeOnEsc = TRUE, + closeOnClickOutside = TRUE, + html = TRUE, + showConfirmButton = TRUE, + showCancelButton = FALSE, + btn_labels = "OK", + btn_colors = "#1d8fe1", + timer = NULL, + imageUrl = "", + animation = TRUE + ) + }) + + missingModal <- function(session) { + ns <- session$ns + modalDialog( + h3(strong(("Completeness of bibliographic metadata"))), + DT::DTOutput(ns("missingDataTable")), + # br(), + # verbatimTextOutput("missingMessage"), + size = "l", + easyClose = TRUE, + footer = tagList( + actionButton(label="Advice", inputId = "missingMessage", + icon = icon("exclamation-sign", lib = "glyphicon")), + screenshotButton(label="Save", id = "missingDataTable", + scale = 2, + file=paste("MissingDataTable-", Sys.Date(), ".png", sep="")), + modalButton("Close")), + ) + } + + # observeEvent(event_data("plotly_click"), { + # if (input$sidebarmenu=="thematicMap"){ + # showModal(plotModal(session)) + # } + # }) + ## export functions ---- output$collection.save <- downloadHandler( filename = function() { @@ -495,7 +617,7 @@ server <- function(input, output,session){ content <- function(file) { tr <- FALSE if ("CR" %in% names(values$M)) tr <- (sum(nchar(values$M$CR)>32767, na.rm=TRUE))>0 - + if (tr & input$save_file=="xlsx"){ show_alert( text = tags$span( @@ -522,12 +644,12 @@ server <- function(input, output,session){ ) suppressWarnings(openxlsx::write.xlsx(values$M, file=file)) } else { - switch(input$save_file, - xlsx={suppressWarnings(openxlsx::write.xlsx(values$M, file=file))}, - RData={ - M=values$M - save(M, file=file) - }) + switch(input$save_file, + xlsx={suppressWarnings(openxlsx::write.xlsx(values$M, file=file))}, + RData={ + M=values$M + save(M, file=file) + }) } }, contentType = input$save_file @@ -784,7 +906,8 @@ server <- function(input, output,session){ values$ApiOk <- 1 values$M <- M values$Morig = M - + if (ncol(values$M)>1){values$rest_sidebar <- TRUE} + if (ncol(values$M)>1){showModal(missingModal(session))} values$Histfield = "NA" values$results = list("NA") contentTable(values) @@ -802,6 +925,8 @@ server <- function(input, output,session){ values$ApiOk <- 1 values$M <- M values$Morig = M + if (ncol(values$M)>1){values$rest_sidebar <- TRUE} + if (ncol(values$M)>1){showModal(missingModal(session))} values$Histfield = "NA" values$results = list("NA") } @@ -830,7 +955,8 @@ server <- function(input, output,session){ MData = MData[nome] DT::datatable(MData,escape = FALSE,rownames = FALSE, extensions = c("Buttons"), options = list( - pageLength = 5, + pageLength = 3, + autoWidth = FALSE, scrollX = TRUE, dom = 'Bfrtip', buttons = list(list(extend = 'pageLength'), list(extend = 'print')), @@ -929,7 +1055,8 @@ server <- function(input, output,session){ Mdisp=as.data.frame(apply(values$M,2,function(x){substring(x,1,150)}),stringsAsFactors = FALSE) if (dim(Mdisp)[1]>0){ DT::datatable(Mdisp, rownames = FALSE, extensions = c("Buttons"), - options = list(pageLength = 10, dom = 'Bfrtip', + options = list(pageLength = 3, dom = 'Bfrtip', + autoWidth = FALSE, scrollX = TRUE, buttons = list('pageLength', list(extend = 'copy'), list(extend = 'csv', @@ -1160,7 +1287,7 @@ server <- function(input, output,session){ }, content <- function(file) { - ggsave(filename = file, plot = values$ASPplot, dpi = as.numeric(input$ASPdpi), height = input$ASPh, width = input$ASPh*2, bg="white") + ggsave(filename = file, plot = values$ASPplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1192,29 +1319,15 @@ server <- function(input, output,session){ ## Annual Citation per Year ---- output$AnnualTotCitperYearPlot <- renderPlotly({ - if (values$results[[1]]=="NA"){ - values$results=biblioAnalysis(values$M)} - x=values$results - - # Total Citation Plot - Table2=aggregate(x$TotalCitation,by=list(x$Years),length) - Table2$xx=aggregate(x$TotalCitation,by=list(x$Years),mean)$x - Table2$Annual=NA - d=date() - d=as.numeric(substring(d,nchar(d)-3,nchar(d))) - Table2$Years=d-Table2$Group.1 - Table2$Annual=Table2$xx/Table2$Years - names(Table2)=c("Year","N","MeanTCperArt","MeanTCperYear","CitableYears") - - ## inserting missing years - YY=setdiff(seq(min(x$Years,na.rm=TRUE),max(x$Years,na.rm=TRUE)),Table2$Year) - if (length(YY>0)){ - YY=data.frame(YY,0,0,0,0) - names(YY)=c("Year","N","MeanTCperArt","MeanTCperYear","CitableYears") - Table2=rbind(Table2,YY) - Table2=Table2[order(Table2$Year),] - row.names(Table2)=Table2$Year} - + current_year = as.numeric(substr(Sys.Date(),1,4))+1 + Table2 <- values$M %>% + group_by(PY) %>% + summarize(MeanTCperArt=round(mean(TC, na.rm=TRUE),2), + N =n()) %>% + mutate(MeanTCperYear = round(MeanTCperArt/(current_year-.data$PY),2), + CitableYears = current_year-PY) %>% + rename(Year = PY) %>% + drop_na() values$AnnualTotCitperYear=Table2 Table2$group="A" @@ -1262,7 +1375,7 @@ server <- function(input, output,session){ paste("AverageArticleCitationPerYear-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$ACpYplot, dpi = as.numeric(input$ACpYdpi), height = input$ACpYh, width = input$ACpYh*2, bg="white") + ggsave(filename = file, plot = values$ACpYplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1350,7 +1463,7 @@ server <- function(input, output,session){ paste("MostRelevantSources-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MRSplot, dpi = as.numeric(input$MRSdpi), height = input$MRSh, width = input$MRSh*2, bg="white") + ggsave(filename = file, plot = values$MRSplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1426,7 +1539,7 @@ server <- function(input, output,session){ paste("MostLocalCitedSources-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MLCSplot, dpi = as.numeric(input$MLCSdpi), height = input$MLCSh, width = input$MLCSh*2, bg="white") + ggsave(filename = file, plot = values$MLCSplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1489,7 +1602,7 @@ server <- function(input, output,session){ paste("BradfordLaws-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$bradford$graph, dpi = as.numeric(input$BLdpi), height = input$BLh, width = input$BLh*2, bg="white") + ggsave(filename = file, plot = values$bradford$graph, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1547,7 +1660,7 @@ server <- function(input, output,session){ paste("SourceImpact-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$SIplot, dpi = as.numeric(input$SIdpi), height = input$SIh, width = input$SIh*2, bg="white") + ggsave(filename = file, plot = values$SIplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1662,7 +1775,7 @@ server <- function(input, output,session){ paste("SourceDynamics-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$SDplot, dpi = as.numeric(input$SDdpi), height = input$SDh, width = input$SDh*2, bg="white") + ggsave(filename = file, plot = values$SDplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1782,7 +1895,7 @@ server <- function(input, output,session){ paste("MostRelevantAuthors-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MRAplot, dpi = as.numeric(input$MRAdpi), height = input$MRAh, width = input$MRAh*2, bg="white") + ggsave(filename = file, plot = values$MRAplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1862,7 +1975,7 @@ server <- function(input, output,session){ paste("MostLocalCitedAuthors-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MLCAplot, dpi = as.numeric(input$MLCAdpi), height = input$MLCAh, width = input$MLCAh*2, bg="white") + ggsave(filename = file, plot = values$MLCAplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1927,7 +2040,7 @@ server <- function(input, output,session){ paste("AuthorImpact-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$AIplot, dpi = as.numeric(input$AIdpi), height = input$AIh, width = input$AIh*2, bg="white") + ggsave(filename = file, plot = values$AIplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -1986,7 +2099,7 @@ server <- function(input, output,session){ paste("AuthorsProductionOverTime-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$AUProdOverTime$graph, dpi = as.numeric(input$APOTdpi), height = input$APOTh, width = input$APOTh*2.5, bg="white") + ggsave(filename = file, plot = values$AUProdOverTime$graph, dpi = values$dpi, height = values$h, width = values$h*2.5, bg="white") }, contentType = "png" ) @@ -2105,7 +2218,7 @@ server <- function(input, output,session){ paste("LotkaLaw-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$LLplot, dpi = as.numeric(input$LLdpi), height = input$LLh, width = input$LLh*2, bg="white") + ggsave(filename = file, plot = values$LLplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2179,7 +2292,7 @@ server <- function(input, output,session){ paste("MostRelevantAffiliations-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$AFFplot, dpi = as.numeric(input$AFFdpi), height = input$AFFh, width = input$AFFh*2, bg="white") + ggsave(filename = file, plot = values$AFFplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2243,7 +2356,7 @@ server <- function(input, output,session){ paste("AffiliationOverTime-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$AffOverTimePlot, dpi = as.numeric(input$AFFGrowthdpi), height = input$SDh, width = input$AFFGrowthh*2, bg="white") + ggsave(filename = file, plot = values$AffOverTimePlot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2369,7 +2482,7 @@ server <- function(input, output,session){ paste("MostRelevantCountries-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MRCOplot, dpi = as.numeric(input$MRCOdpi), height = input$MRCOh, width = input$MRCOh*2, bg="white") + ggsave(filename = file, plot = values$MRCOplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2432,7 +2545,7 @@ server <- function(input, output,session){ paste("CountryScientificProduction-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$mapworld$g, dpi = as.numeric(input$CSPdpi), height = input$CSPh, width = input$CSPh*2, bg="white") + ggsave(filename = file, plot = values$mapworld$g, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2488,7 +2601,7 @@ server <- function(input, output,session){ paste("CountryOverTime-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$CountryOverTimePlot, dpi = as.numeric(input$COGrowthdpi), height = input$COGrowthh, width = input$COGrowthh*2, bg="white") + ggsave(filename = file, plot = values$CountryOverTimePlot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2599,7 +2712,7 @@ server <- function(input, output,session){ paste("MostCitedCountries-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MCCplot, dpi = as.numeric(input$MCCdpi), height = input$MCCh, width = input$MCCh*2, bg="white") + ggsave(filename = file, plot = values$MCCplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2682,7 +2795,7 @@ server <- function(input, output,session){ paste("MostGlobalCitedDocuments-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MGCDplot, dpi = as.numeric(input$MGCDdpi), height = input$MGCDh, width = input$MGCDh*2, bg="white") + ggsave(filename = file, plot = values$MGCDplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2770,7 +2883,7 @@ server <- function(input, output,session){ paste("MostLocalCitedDocuments-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MLCDplot, dpi = as.numeric(input$MLCDdpi), height = input$MLCDh, width = input$MLCDh*2, bg="white") + ggsave(filename = file, plot = values$MLCDplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2849,7 +2962,7 @@ server <- function(input, output,session){ paste("MostLocalCitedReferences-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MLCRplot, dpi = as.numeric(input$MLCRdpi), height = input$MLCRh, width = input$MLCRh*2, bg="white") + ggsave(filename = file, plot = values$MLCRplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -2921,7 +3034,7 @@ server <- function(input, output,session){ paste("ReferenceSpectroscopy-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$res$spectroscopy, dpi = as.numeric(input$RSdpi), height = input$RSh, width = input$RSh*2, bg="white") + ggsave(filename = file, plot = values$res$spectroscopy, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -3069,7 +3182,7 @@ server <- function(input, output,session){ paste("MostRelevantWords-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$MRWplot, dpi = as.numeric(input$MRWdpi), height = input$MRWh, width = input$MRWh*2, bg="white") + ggsave(filename = file, plot = values$MRWplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -3419,7 +3532,7 @@ server <- function(input, output,session){ paste("WordsFrequencyOverTime-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$WDplot, dpi = as.numeric(input$WDdpi), height = input$WDh, width = input$WDh*2, bg="white") + ggsave(filename = file, plot = values$WDplot, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -3548,7 +3661,7 @@ server <- function(input, output,session){ paste("TrendTopics-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$trendTopics$graph, dpi = as.numeric(input$TTdpi), height = input$TTh, width = input$TTh*2, bg="white") + ggsave(filename = file, plot = values$trendTopics$graph, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -3609,7 +3722,8 @@ server <- function(input, output,session){ stemming=input$CMstemming, size=input$sizeCM, label.term = input$CMlabeling, n.labels=input$CMn.labels, repel=FALSE) - + values$CM$data <- values$CM$data[,c(1,5,2)] + values$CM$clusters <- values$CM$clusters[,c(7,1:4,6)] validate( need(values$CM$nclust > 0, "\n\nNo clusters in one or more periods. Please select a different set of parameters.") ) @@ -3633,15 +3747,15 @@ server <- function(input, output,session){ paste("CouplingMap-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$CM$map, dpi = as.numeric(input$CMdpi), height = input$CMh, width = input$CMh*2, bg="white") + ggsave(filename = file, plot = values$CM$map, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) output$CMTable <- DT::renderDT({ CMMAP() - cmData=values$CM$data[,c(2,1,3,5)] - + #cmData=values$CM$data[,c(2,1,3,5)] + cmData <- values$CM$data DT::datatable(cmData, escape = FALSE, rownames = FALSE, extensions = c("Buttons"),filter = 'top', options = list(pageLength = 10, dom = 'Bfrtip', buttons = list('pageLength', @@ -3666,8 +3780,8 @@ server <- function(input, output,session){ output$CMTableCluster <- DT::renderDT({ CMMAP() - cmData=values$CM$clusters[,c(7,1:4,6)] - + #cmData=values$CM$clusters[,c(7,1:4,6)] + cmData <- values$CM$clusters DT::datatable(cmData, escape = FALSE, rownames = FALSE, extensions = c("Buttons"),filter = 'top', options = list(pageLength = 10, dom = 'Bfrtip', buttons = list('pageLength', @@ -3690,6 +3804,23 @@ server <- function(input, output,session){ formatStyle(names(cmData), backgroundColor = 'white') }) + observeEvent(input$reportCM,{ + if(!is.null(values$CM$data)){ + popUp(title=NULL, type="waiting") + list_df <- list(values$CM$params, + values$CM$data, + values$CM$clusters) + list_plot <- list(values$CM$map, + values$CM$net$graph) + wb <- addSheetToReport(list_df, list_plot, sheetname="CouplingMap", wb=values$wb) + values$wb <- wb + popUp(title="Coupling Map", type="success") + values$myChoices <- sheets(values$wb) + } else { + popUp(type="error") + } + }) + # CONCEPTUAL STRUCTURE ---- ### Network approach ---- #### Co-occurrences network ---- @@ -3740,12 +3871,6 @@ server <- function(input, output,session){ contentType = "html" ) - ### save coc network as png ### - observeEvent(input$cocPlot.save, { - file <- paste("Co_occurrence_Network-", Sys.Date(), ".png", sep="") - screenshot(selector="#cocPlot", scale=input$cocRes, filename=file) - }) - output$cocTable <- DT::renderDT({ COCnetwork() cocData=values$cocnet$cluster_res @@ -3787,7 +3912,7 @@ server <- function(input, output,session){ list_plot <- list(values$degreePlot) res <- addDataScreenWb(list_df, wb=values$wb, sheetname=sheetname) #values$wb <- res$wb - values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+16, width=10, height=7, dpi=300) + values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+16, width=10, height=7, dpi=75) values$fileTFP <- screenSh(selector = "#cocPlot") ## screenshot values$list_file <- rbind(values$list_file, c(sheetname=res$sheetname,values$fileTFP,res$col)) popUp(title="Co-occurrence Network", type="success") @@ -3819,45 +3944,114 @@ server <- function(input, output,session){ } }) - output$FA1plot.save <- downloadHandler( + output$FAplot.save <- downloadHandler( filename = function() { - paste("FactorialMap-", Sys.Date(), ".png", sep="") - }, - content <- function(file) { - ggsave(filename = file, plot = values$CS$graph_terms, dpi = as.numeric(input$FAdpi), height = input$FAh, width = input$FAh*1.5, bg="white") - }, - contentType = "png" - ) - - output$FA2plot.save <- downloadHandler( - filename = function() { - paste("Dendrogram-", Sys.Date(), ".png", sep="") - }, - content <- function(file) { - ggsave(filename = file, plot = values$CS$graph_dendogram, dpi = as.numeric(input$FAdpi), height = input$FAh, width = input$FAh*2, bg="white") - }, - contentType = "png" - ) - - output$FA3plot.save <- downloadHandler( - filename = function() { - paste("MostContribDocuments-", Sys.Date(), ".png", sep="") + # + paste("FactorialAnalysis_", Sys.Date(), ".zip", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$CS$graph_documents_Contrib, dpi = as.numeric(input$FAdpi), height = input$FAh, width = input$FAh*1.5, bg="white") + #go to a temp dir to avoid permission issues + owd <- setwd(tempdir()) + on.exit(setwd(owd)) + files <- c(paste("FactorialMap_", Sys.Date(), ".png", sep=""), + paste("Dendrogram_", Sys.Date(), ".png", sep=""), + paste("MostContribDocuments_", Sys.Date(), ".png", sep=""), + paste("MostCitedDocuments_", Sys.Date(), ".png", sep="") + ) + ggsave(filename = files[1], plot = values$CS$graph_terms, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + ggsave(filename = files[2], plot = values$CS$graph_dendogram,dpi = values$dpi, height = values$h, width = values$h*2, bg="white") + ggsave(filename = files[3], plot = values$CS$graph_documents_Contrib, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + ggsave(filename = files[4], plot = values$CS$graph_documents_TC, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + + zip(file,files) }, - contentType = "png" + contentType = "zip" ) - output$FA4plot.save <- downloadHandler( - filename = function() { - paste("MostCitedDocuments-", Sys.Date(), ".png", sep="") - }, - content <- function(file) { - ggsave(filename = file, plot = values$CS$graph_documents_TC, dpi = as.numeric(input$FAdpi), height = input$FAh, width = input$FAh*1.5, bg="white") - }, - contentType = "png" - ) + # saveFAModal <- function(session) { + # ns <- session$ns + # modalDialog( + # h3(strong("Download Plots in PNG")), + # br(), + # h4("Factorial Map"), + # div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + # #align = "center", + # width="100%", + # downloadBttn(outputId = "FA1plot.save", label = (" "), + # style = "pill", color = "primary")), + # br(), + # h4("Dendrogram"), + # div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + # #align = "center", + # width="100%", + # downloadBttn(outputId = "FA2plot.save", label = (" "), + # style = "pill", color = "primary")), + # br(), + # h4("Most Contributing Docs"), + # div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + # #align = "center", + # width="100%", + # downloadBttn(outputId = "FA3plot.save", label = (" "), + # style = "pill", color = "primary")), + # br(), + # h4("Most Cited Docs"), + # div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + # #align = "center", + # width="100%", + # downloadBttn(outputId = "FA4plot.save", label = (" "), + # style = "pill", color = "primary")), + # size = "s", + # easyClose = TRUE, + # footer = tagList( + # modalButton("Close")), + # ) + # } + # + # observeEvent(input$FAplot.save, { + # if (input$sidebarmenu=="factorialAnalysis"){ + # showModal(saveFAModal(session)) + # } + # }) + + # output$FA1plot.save <- downloadHandler( + # filename = function() { + # paste("FactorialMap-", Sys.Date(), ".png", sep="") + # }, + # content <- function(file) { + # ggsave(filename = file, plot = values$CS$graph_terms, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + # }, + # contentType = "png" + # ) + # + # output$FA2plot.save <- downloadHandler( + # filename = function() { + # paste("Dendrogram-", Sys.Date(), ".png", sep="") + # }, + # content <- function(file) { + # ggsave(filename = file, plot = values$CS$graph_dendogram,dpi = values$dpi, height = values$h, width = values$h*2, bg="white") + # }, + # contentType = "png" + # ) + # + # output$FA3plot.save <- downloadHandler( + # filename = function() { + # paste("MostContribDocuments-", Sys.Date(), ".png", sep="") + # }, + # content <- function(file) { + # ggsave(filename = file, plot = values$CS$graph_documents_Contrib, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + # }, + # contentType = "png" + # ) + # + # output$FA4plot.save <- downloadHandler( + # filename = function() { + # paste("MostCitedDocuments-", Sys.Date(), ".png", sep="") + # }, + # content <- function(file) { + # ggsave(filename = file, plot = values$CS$graph_documents_TC, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") + # }, + # contentType = "png" + # ) output$CSPlot1 <- renderPlot({ CSfactorial() @@ -4018,7 +4212,7 @@ server <- function(input, output,session){ }) ### click cluster networks - + plotModal <- function(session) { ns <- session$ns modalDialog( @@ -4042,16 +4236,16 @@ server <- function(input, output,session){ output$cocPlotClust <- renderVisNetwork({ values$d <- event_data("plotly_click") - coord <- values$d[c("x","y")] - color <- values$TM$clusters_orig %>% - filter(.data$rcentrality==coord$x,.data$rdensity==coord$y) %>% - select(.data$color) %>% as.character() - g <- values$TM$subgraphs[[color]] - igraph2visClust(g,curved=F,labelsize=4,opacity=0.5,shape="dot", shadow=TRUE, edgesize=5)$VIS + coord <- values$d[c("x","y")] + color <- values$TM$clusters_orig %>% + filter(.data$rcentrality==coord$x,.data$rdensity==coord$y) %>% + select(.data$color) %>% as.character() + g <- values$TM$subgraphs[[color]] + igraph2visClust(g,curved=F,labelsize=4,opacity=0.5,shape="dot", shadow=TRUE, edgesize=5)$VIS }) ### end click cluster subgraphs - + output$NetPlot <- renderVisNetwork({ TMAP() values$networkTM<-igraph2vis(g=values$TM$net$graph,curved=(input$coc.curved=="Yes"), @@ -4081,7 +4275,7 @@ server <- function(input, output,session){ paste("ThematicMap-", Sys.Date(), ".png", sep="") }, content <- function(file) { - ggsave(filename = file, plot = values$TM$map, dpi = as.numeric(input$TMdpi), height = input$TMh, width = input$TMh*1.5, bg="white") + ggsave(filename = file, plot = values$TM$map, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") }, contentType = "png" ) @@ -4141,7 +4335,7 @@ server <- function(input, output,session){ output$TMTableDocument <- DT::renderDT({ TMAP() tmDataDoc <- values$TM$documentToClusters - + DT::datatable(tmDataDoc, escape = FALSE, rownames = FALSE, extensions = c("Buttons"),filter = 'top', options = list(pageLength = 10, dom = 'Bfrtip', buttons = list('pageLength', @@ -4217,8 +4411,12 @@ server <- function(input, output,session){ ### end of block values$yearSlices <- as.numeric() - for (i in 1:as.integer(input$numSlices)){ - if (length(input[[paste0("Slice", i)]])>0){values$yearSlices=c(values$yearSlices,input[[paste0("Slice", i)]])} + if (is.null(input$numSlices)){ + values$yearSlices <- median(values$M$PY, na.rm=TRUE) + }else{ + for (i in 1:as.integer(input$numSlices)){ + if (length(input[[paste0("Slice", i)]])>0){values$yearSlices <- c(values$yearSlices,input[[paste0("Slice", i)]])} + } } if (length(values$yearSlices)>0){ @@ -4275,9 +4473,17 @@ server <- function(input, output,session){ for (i in 1:length(values$nexus$TM)){ fileName <- paste("ThematicEvolution-Map_",i,"_",Sys.Date(), ".png", sep="") - ggsave(filename = fileName, plot = values$nexus$TM[[i]]$map, dpi = as.numeric(input$TEdpi), height = input$TEh, width = input$TEh*1.5, bg="white") + ggsave(filename = fileName, plot = values$nexus$TM[[i]]$map, dpi = values$dpi, height = values$h, width = values$h*1.5, bg="white") files <- c(fileName,files) } + screenshot( + filename = paste("ThematicEvolution_", Sys.Date(), ".png", sep=""), + id = "TEPlot", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) zip(file,files) }, contentType = "zip" @@ -4811,13 +5017,13 @@ server <- function(input, output,session){ #values$wb <- res$wb values$fileTFP <- screenSh(selector = "#TEPlot") ## screenshot values$list_file <- rbind(values$list_file, c(sheetname=res$sheetname,values$fileTFP,res$col)) - + ## Periods L <- length(values$nexus$TM) wb <- res$wb for (l in 1:L){ if(!is.null(values$nexus$TM[[l]]$words)){ - + list_df <- list(values$nexus$TM[[l]]$params, values$nexus$TM[[l]]$words, values$nexus$TM[[l]]$clusters, @@ -4859,11 +5065,6 @@ server <- function(input, output,session){ contentType = "net" ) - observeEvent(input$cocitPlot.save, { - file <- paste("Co_citation_Network-", Sys.Date(), ".png", sep="") - screenshot(selector="#cocitPlot", scale=input$cocitRes, filename=file) - }) - output$cocitTable <- DT::renderDT({ COCITnetwork() cocitData=values$cocitnet$cluster_res @@ -4907,7 +5108,7 @@ server <- function(input, output,session){ }) observeEvent(input$reportCOCIT,{ - + if(!is.null(values$cocitnet$cluster_res)){ names(values$cocitnet$cluster_res) <- c("Node", "Cluster", "Betweenness", "Closeness", "PageRank") sheetname <- "CoCitNet" @@ -4915,7 +5116,7 @@ server <- function(input, output,session){ list_plot <- list(values$degreePlot) res <- addDataScreenWb(list_df, wb=values$wb, sheetname=sheetname) #values$wb <- res$wb - values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+15, width=12, height=8, dpi=300) + values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+15, width=12, height=8, dpi=75) values$fileTFP <- screenSh(selector = "#cocitPlot") ## screenshot values$list_file <- rbind(values$list_file, c(sheetname=res$sheetname,values$fileTFP,res$col)) popUp(title="Co-citation Network", type="success") @@ -4933,12 +5134,6 @@ server <- function(input, output,session){ }) }) - ### screenshot Button Historiograph - observeEvent(input$HGplot.save, { - file <- paste("Historiograph-", Sys.Date(), ".png", sep="") - screenshot(selector="#histPlotVis", scale=input$HGh, filename=file) - }) - output$histPlotVis <- renderVisNetwork({ g <- Hist() values$histPlotVis<-hist2vis(values$histPlot,curved=FALSE, @@ -5028,11 +5223,6 @@ server <- function(input, output,session){ contentType = "net" ) - observeEvent(input$colPlot.save, { - file <- paste("Collaboration_Network-", Sys.Date(), ".png", sep="") - screenshot(selector="#colPlot", scale=input$colRes, filename=file) - }) - output$colTable <- DT::renderDT({ COLnetwork() colData=values$colnet$cluster_res @@ -5081,7 +5271,7 @@ server <- function(input, output,session){ list_df <- list(values$colnet$params, values$colnet$cluster_res) list_plot <- list(values$degreePlot) res <- addDataScreenWb(list_df, wb=values$wb, sheetname=sheetname) - values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+15, width=12, height=8, dpi=300) + values$wb <- addGgplotsWb(list_plot, wb=res$wb, sheetname, col=res$col+15, width=12, height=8, dpi=75) values$fileTFP <- screenSh(selector = "#colPlot") ## screenshot values$list_file <- rbind(values$list_file, c(sheetname=res$sheetname,values$fileTFP,res$col)) popUp(title="Collaboration Network", type="success") @@ -5105,7 +5295,7 @@ server <- function(input, output,session){ }, content <- function(file) { g <- values$WMmap$g + labs(title = "Country Collaboration Map") - ggsave(filename = file, plot = g, dpi = as.numeric(input$CCdpi), height = input$CCh, width = input$CCh*2, bg="white") + ggsave(filename = file, plot = g, dpi = values$dpi, height = values$h, width = values$h*2, bg="white") }, contentType = "png" ) @@ -5238,2801 +5428,111 @@ server <- function(input, output,session){ values$list_file <- data.frame(sheet=NULL,file=NULL,n=NULL) values$wb <- openxlsx::createWorkbook() } - }, ignoreNULL = TRUE + }, ignoreNULL = TRUE ) - - + + # OPTIONS MENU ---- - observe({ - if (!(input$sidebarmenu %in% c("biblioshinyy","mainInfo", "report")) & !isTRUE(values$checkControlBar)){ - updateControlbar("controlbar2") - values$checkControlBar <- TRUE - } - if ((input$sidebarmenu %in% c("biblioshinyy","mainInfo", "report")) & isTRUE(values$checkControlBar)){ - updateControlbar("controlbar2") - values$checkControlBar <- FALSE - } + # observe({ + # if (!(input$sidebarmenu %in% c("biblioshinyy","mainInfo", "report")) & !isTRUE(values$checkControlBar)){ + # updateControlbar("controlbar2") + # values$checkControlBar <- TRUE + # } + # if ((input$sidebarmenu %in% c("biblioshinyy","mainInfo", "report")) & isTRUE(values$checkControlBar)){ + # updateControlbar("controlbar2") + # values$checkControlBar <- FALSE + # } + # }) + + ### screenshot buttons + observeEvent(input$screenTFP,{ + screenshot( + filename = paste("ThreeFieldPlot-", Sys.Date(), ".png", sep=""), + id = "ThreeFieldsPlot", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) }) - output$controlbar <- renderUI({ - controlbarMenu( - controlbarItem( - h2(strong("Options"),align="center"), - fluidPage( - fluidRow( - column(width = 1), - column(width=11, - ### Load Data ---- - conditionalPanel(condition = 'input.sidebarmenu == "loadData"', - h3(strong("Import or Load ")), - selectInput( - "load", - label = "Please, choose what to do", - choices = c( - " " = "null", - "Import raw file(s)" = "import", - "Load bibliometrix file(s)" = "load", - "Use a sample collection" = "demo" - ), - selected = "null" - ), - conditionalPanel( - condition = "input.load == 'demo'", - helpText(h4(strong("The use of bibliometric approaches in business and management disciplines.")), - h5(strong("Dataset 'Management'")), - em("A collection of scientific articles about the use of bibliometric approaches", - "in business and management disciplines."), - br(), - em("Period: 1985 - 2020 - , Source WoS.") - ) - ), - conditionalPanel( - condition = "input.load == 'import'", - selectInput( - "dbsource", - label = "Database", - choices = c( - "Web of Science (WoS/WoK)" = "isi", - "Scopus" = "scopus", - "Dimensions" = "dimensions", - "Lens.org" = "lens", - "PubMed" = "pubmed", - "Cochrane Library" = "cochrane" - ), - selected = "isi" - ) - ), - conditionalPanel( - condition = "input.load != 'null' & input.load != 'demo'", - conditionalPanel( - condition = "input.load == 'load'", - helpText(em("Load a collection in XLSX or R format previously exported from bibliometrix") - )), - fileInput( - "file1", - "Choose a file", - multiple = FALSE, - accept = c( - ".csv", - ".txt", - ".ciw", - ".bib", - ".xlsx", - ".zip", - ".xls", - ".rdata", - ".rda", - ".rds" - ) - ) - ), - conditionalPanel(condition = "input.load != 'null'", - actionButton("applyLoad", strong("START"), - style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%"), - width = "100%"), - tags$hr(), - uiOutput("textLog"), - tags$hr(), - h3(strong( - "Export collection" - )), - selectInput( - 'save_file', - 'Save as:', - choices = c( - ' ' = 'null', - 'Excel' = 'xlsx', - 'R Data Format' = 'RData' - ), - selected = 'null' - ), - conditionalPanel(condition = "input.save_file != 'null'", - downloadButton("collection.save", strong("Export"), - style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%") - ) - ), - ## Gathering Data ---- - conditionalPanel(condition = 'input.sidebarmenu == "gathData"', - h3(strong( - "Gather data using APIs " - )), - br(), - selectInput( - "dbapi", - label = "Database", - choices = c("DS Dimensions" = "ds", - "PubMed" = "pubmed"), - selected = "pubmed" - ), - ## Dimenions API - conditionalPanel( - condition = "input.dbapi == 'ds'", - br(), - actionButton("dsShow", h5(strong("1. Configure API request")), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - h5(tags$b("Your Query")), - verbatimTextOutput("queryLog2", placeholder = FALSE), - h5(tags$b("Documents returned using your query")), - verbatimTextOutput("sampleLog2", placeholder = FALSE), - ), - ### Pubmed API - conditionalPanel( - condition = "input.dbapi == 'pubmed'", - br(), - actionButton("pmShow", h5(strong("1. Configure API request")), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - h5(tags$b("Your Query")), - verbatimTextOutput("pmQueryLog2", placeholder = FALSE), - h5(tags$b("Documents returned using your query")), - verbatimTextOutput("pmSampleLog2", placeholder = FALSE), - ), - tags$hr(), - actionButton("apiApply", h5(strong("2. Download metadata")), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - tags$hr(), - h3(strong( - "Export a bibliometrix file " - )), - br(), - selectInput( - 'save_file_api', - 'Save as:', - choices = c( - ' ' = 'null', - 'Excel' = 'xlsx', - 'R Data Format' = 'RData' - ), - selected = 'null' - ), - conditionalPanel(condition = "input.save_file_api != 'null'", - downloadButton("collection.save_api", strong("Export"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Filters ---- - conditionalPanel(condition = 'input.sidebarmenu == "filters"', - h3(strong("Filters")), - br(), - actionButton("applyFilter", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%", - icon = fa_i(name ="play")), - h5(" "), - box(h6(htmlOutput("textDim")), - width = "100%"), - br(), - uiOutput("selectLA"), - uiOutput("sliderPY"), - uiOutput("selectType"), - uiOutput("sliderTCpY"), - selectInput("bradfordSources", - label = "Source by Bradford Law Zones", - choices = c("Core Sources"="core", - "Core + Zone 2 Sources"="zone2", - "All Sources"="all"), - selected = "all") - ), - ## Annual Scientific Prod ---- - conditionalPanel(condition = 'input.sidebarmenu == "annualScPr"', - br(), - # h4(strong("Annual Growth Rate")), - # br(), - # verbatimTextOutput("CAGR", placeholder = TRUE), - # br(), - # selectInput( - # 'ASPdpi', - # label = h4(strong("Export plot")), - # choices=c( - # "dpi value" = "null", - # "75 dpi" = "75", - # "150 dpi" = "150", - # "300 dpi" = "300", - # "600 dpi" = "600" - # ), - # selected = "null" - # ) - ), - br(), - # br(), - # conditionalPanel(condition = 'input.sidebarmenu == "annualScPr" & input.ASPdpi != "null"', - # sliderInput( - # 'ASPh', - # label =h4(em(strong("Height (in inches)"))), - # value = 7, min = 1, max = 20, step = 1), - # downloadButton("ASPplot.save", strong("Export plot as png"), - # style ="border-radius: 10px; border-width: 3px; vertical-align: 'middle';font-size: 20px;", - # width = "100%") - # ), - ## Average Cit Per Year ---- - conditionalPanel(condition = 'input.sidebarmenu == "averageCitPerYear"', - br(), - selectInput( - 'ACpYdpi', - h4(strong("Export plot"), align ="center"), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.ACpYdpi != 'null'", - sliderInput( - 'ACpYh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("ACpYplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%") - ) - ), - ## Three field Plot ---- - conditionalPanel(condition = 'input.sidebarmenu == "threeFieldPlot"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - fluidRow( - (column(6, selectInput("CentralField", - label = "Middle Field", - choices = c("Authors" = "AU", - "Affiliations" = "AU_UN", - "Countries"="AU_CO", - "Keywords" = "DE", - "Keywords Plus" = "ID", - "Titles" = "TI_TM", - "Abstract" = "AB_TM", - "Sources" = "SO", - "References" = "CR", - "Cited Sources" = "CR_SO"), - selected = "AU"))), - (column(6,numericInput("CentralFieldn", - label=("Number of items"), - min = 1, max = 50, step = 1, value = 20)))), - fluidRow( - (column(6,selectInput("LeftField", - label = "Left Field", - choices = c("Authors" = "AU", - "Affiliations" = "AU_UN", - "Countries"="AU_CO", - "Keywords" = "DE", - "Keywords Plus" = "ID", - "Titles" = "TI_TM", - "Abstract" = "AB_TM", - "Sources" = "SO", - "References" = "CR", - "Cited Sources" = "CR_SO"), - selected = "CR"))), - (column(6, numericInput("LeftFieldn", - label=("Number of items"), - min = 1, max = 50, step = 1, value = 20)))), - fluidRow( - (column(6,selectInput("RightField", - label = "Right Field", - choices = c("Authors" = "AU", - "Affiliations" = "AU_UN", - "Countries"="AU_CO", - "Keywords" = "DE", - "Keywords Plus" = "ID", - "Titles" = "TI_TM", - "Abstract" = "AB_TM", - "Sources" = "SO", - "References" = "CR", - "Cited Sources" = "CR_SO"), - selected = "DE"))), - (column(6,numericInput("RightFieldn", - label=("Number of items"), - min = 1, max = 50, step = 1, value = 20)))) - ) - ), - ## Relevant Sources ---- - conditionalPanel(condition = 'input.sidebarmenu == "relevantSources"', - h4(strong("Parameters: ")), - " ", - numericInput("MostRelSourcesK", - label=("Number of Sources"), - value = 10), - br(), - selectInput( - 'MRSdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MRSdpi != 'null'", - sliderInput( - 'MRSh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MRSplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%") - ) - ), - ## Most Local Cited Sources ---- - conditionalPanel(condition ='input.sidebarmenu == "localCitedSources"', - h4(strong("Parameters: ")), - " ", - numericInput("MostRelCitSourcesK", - label=("Number of Sources"), - value = 10), - br(), - selectInput( - 'MLCSdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MLCSdpi != 'null'", - sliderInput( - 'MLCSh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MLCSplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px; font-size: 20px;", - width = "100%") - ) - ), - ## Bradford Law ---- - conditionalPanel(condition ='input.sidebarmenu == "bradford"', - br(), - selectInput( - 'BLdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.BLdpi != 'null'", - sliderInput( - 'BLh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("BLplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - )), - ## Source Impact ---- - conditionalPanel(condition ='input.sidebarmenu == "sourceImpact"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("HmeasureSources", - label = "Impact measure", - choices = c("H-Index"="h", - "G-Index"="g", - "M-Index"="m", - "Total Citation"="tc"), - selected = "h"), - " ", - numericInput("Hksource", - label=("Number of sources"), - value = 10)), - br(), - selectInput( - 'SIdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.SIdpi != 'null'", - sliderInput( - 'SIh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("SIplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Source Dynamics ---- - conditionalPanel(condition ='input.sidebarmenu == "sourceDynamics"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("cumSO", "Occurrences", - choices = c("Cumulate" = "Cum", - "Per year" = "noCum"), - selected = "Cum"), - hr(), - sliderInput("topSO", label = "Number of Sources", min = 1, max = 50, step = 1, value = c(1,5))), - br(), - selectInput( - 'SDdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.SDdpi != 'null'", - sliderInput( - 'SDh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("SDplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - )), - ## Most relevant Authors ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostRelAuthors"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - numericInput("MostRelAuthorsK", - label=("Number of Authors"), - value = 10), - " ", - selectInput("AuFreqMeasure", - label = "Frequency measure", - choices = c("N. of Documents "="t", - "Percentage"="p", - "Fractionalized Frequency"="f"), - selected = "t")), - br(), - selectInput( - 'MRAdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MRAdpi != 'null'", - sliderInput( - 'MRAh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MRAplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Local Cited Authors ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostLocalCitedAuthors"', - h4(strong("Parameters: ")), - " ", - numericInput("MostCitAuthorsK", - label=("Number of Authors"), - value = 10), - br(), - selectInput( - 'MLCAdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MLCAdpi != 'null'", - sliderInput( - 'MLCAh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MLCAplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Authors production over time ---- - conditionalPanel(condition = 'input.sidebarmenu == "authorsProdOverTime"', - h4(strong("Parameters: ")), - " ", - numericInput("TopAuthorsProdK", - label=("Number of Authors"), - value = 10), - br(), - selectInput( - 'APOTdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.APOTdpi != 'null'", - sliderInput( - 'APOTh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("APOTplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Lotka law ---- - conditionalPanel(condition = 'input.sidebarmenu == "lotka"', - br(), - selectInput( - 'LLdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.LLdpi != 'null'", - sliderInput( - 'LLh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("LLplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Author Impact ---- - conditionalPanel(condition = 'input.sidebarmenu == "authorImpact"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("HmeasureAuthors", - label = "Impact measure", - choices = c("H-Index"="h", - "G-Index"="g", - "M-Index"="m", - "Total Citation"="tc"), - selected = "h"), - " ", - numericInput("Hkauthor", - label=("Number of authors"), - value = 10)), - br(), - selectInput( - 'AIdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.AIdpi != 'null'", - sliderInput( - 'AIh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("AIplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Relevant Affiliations ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostRelAffiliations"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("disAff", - label = "Affiliation Name Disambiguation", - choices = c("Yes"="Y", - "No"="N"), - selected = "Y"), - " ", - numericInput("MostRelAffiliationsK", - label=("Number of Affiliations"), - value = 10)), - br(), - selectInput( - 'AFFdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.AFFdpi != 'null'", - sliderInput( - 'AFFh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("AFFplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Affiliations' Production over Time ---- - conditionalPanel(condition ='input.sidebarmenu == "AffOverTime"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - sliderInput("topAFF", label = "Number of Affiliations", min = 1, max = 50, step = 1, value = 5)), - br(), - selectInput( - 'AFFGrowthdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.AFFGrowthdpi != 'null'", - sliderInput( - 'AFFGrowthh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("AffOverTimeplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - )), - - ## Corresponding Author country ---- - conditionalPanel(condition = 'input.sidebarmenu == "correspAuthorCountry"', - h4(strong("Parameters: ")), - numericInput("MostRelCountriesK", - label=("Number of Countries"), - value = 20), - br(), - selectInput( - 'MRCOdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MRCOdpi != 'null'", - sliderInput( - 'MRCOh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MRCOplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Country Scientific Production ---- - conditionalPanel(condition = 'input.sidebarmenu == "countryScientProd"', - br(), - selectInput( - 'CSPdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.CSPdpi != 'null'", - sliderInput( - 'CSPh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("CSPplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Countries' Production over Time ---- - conditionalPanel(condition ='input.sidebarmenu == "COOverTime"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - sliderInput("topCO", label = "Number of Countries", min = 1, max = 50, step = 1, value = 5)), - br(), - selectInput( - 'COGrowthdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.COGrowthdpi != 'null'", - sliderInput( - 'COGrowthh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("CountryOverTimeplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Cited Countries ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostCitedCountries"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("CitCountriesMeasure", - label = "Measure", - choices = c("Total Citations"="TC", - "Average Citations per Year"="TCY"), - selected = "TC"), - " ", - numericInput("MostCitCountriesK", - label=("Number of Countries"), - value = 10)), - br(), - selectInput( - 'MCCdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MCCdpi != 'null'", - sliderInput( - 'MCCh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MCCplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Global Cited Documents ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostGlobalCitDoc"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - numericInput("MostCitDocsK", - label=("Number of Documents"), - value = 10), - " ", - selectInput("CitDocsMeasure", - label = "Measure", - choices = c("Total Citations"="TC", - "Total Citations per Year"="TCY"), - selected = "TC")), - br(), - selectInput( - 'MGCDdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MGCDdpi != 'null'", - sliderInput( - 'MGCDh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MGCDplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Local Cited Documents ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostLocalCitDoc"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - numericInput("MostLocCitDocsK", - label=("Number of Documents"), - value = 10), - " ", - selectInput(inputId = "LocCitSep", - label = "Field separator character", - choices = c(";" = ";", - ". " = ". ", - "," = ","), - selected = ";")), - br(), - selectInput( - 'MLCDdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MLCDdpi != 'null'", - sliderInput( - 'MLCDh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MLCDplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Most Local Cited References ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostLocalCitRef"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - numericInput("MostCitRefsK", - label=("Number of Documents"), - value = 10), - " ", - selectInput(inputId = "CitRefsSep", - label = "Field separator character", - choices = c(";" = ";", - ". " = ". ", - "," = ","), - selected = ";")), - br(), - selectInput( - 'MLCRdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MLCRdpi != 'null'", - sliderInput( - 'MLCRh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MLCRplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## References spectroscopy - conditionalPanel(condition = 'input.sidebarmenu == "ReferenceSpect"', - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput(inputId = "rpysSep", - label = "Field separator character", - choices = c(";" = ";", - ". " = ". ", - "," = ","), - selected = ";"), - h4(em(strong("Time slice"))), - fluidRow(column(6, - numericInput(inputId = "rpysMinYear", - label = "Starting Year", - value = NA, - step = 1)), - column(6, - numericInput(inputId = "rpysMaxYear", - label = "End Year", - value = NA, - step = 1) - ))), - br(), - selectInput( - 'RSdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.RSdpi != 'null'", - sliderInput( - 'RSh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("RSplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - - ) - ), - ## Most Frequent Words ---- - conditionalPanel(condition = 'input.sidebarmenu == "mostFreqWords"', - selectInput("MostRelWords", "Field", - choices = c("Keywords Plus" = "ID", - "Author's keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB", - "Subject Categories (WoS)" = "WC"), - selected = "ID"), - conditionalPanel(condition = "input.MostRelWords == 'AB' |input.MostRelWords == 'TI'", - selectInput("MRWngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - numericInput("MostRelWordsN", label = "Number of words", min = 2, max = 100, step = 1, value = 10), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("MostRelWordsStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.MostRelWordsStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("MostRelWordsStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("MostRelWordsSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("MostRelWordsStopPreview")) - ), - selectInput("MRWSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.MRWSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("MRWSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("MRWSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("MRWSynPreview")) - )), - br(), - selectInput( - 'MRWdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.MRWdpi != 'null'", - sliderInput( - 'MRWh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("MRWplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%")) - ), - ## Wordcloud ---- - conditionalPanel(condition = 'input.sidebarmenu == "wcloud"', - h4(em(strong(" "))), - " ", - selectInput("summaryTerms", "Field", - choices = c("Keywords Plus" = "ID", - "Author's keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB", - "Subject Categories (WoS)" = "WC"), - selected = "ID"), - conditionalPanel(condition = "input.summaryTerms == 'AB' |input.summaryTerms == 'TI'", - selectInput("summaryTermsngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - numericInput("n_words", label = "Number of words", min = 10, max = 500, step = 1, value = 50), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("WCStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.WCStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("WCStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - selectInput("WCSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ",") - ), - selectInput("WCSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.WCSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("WCSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("WCSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ",") - )), - br(), - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - selectInput("measure", "Word occurrence by", - choices = c("Frequency" = "freq", - "Square root" = "sqrt", - "Log" = "log", - "Log10" = "log10"), - selected = "freq") - ), - column(6, - selectInput("wcShape", "Shape", - choices = c("Circle" = "circle", - "Cardiod" = "cardioid", - "Diamond" = "diamond", - "Pentagon" = "pentagon", - "Star" = "star", - "Triangle-forward" = "triangle-forward" - ,"Triangle" = "triangle"), - selected = "circle") - )), - fluidRow(column(6, - selectInput("font", label = "Font type", - choices = c("Impact", "Comic Sans MS (No plz!)" = "Comic Sans MS", - "Arial", "Arial Black", "Tahoma", "Verdana", "Courier New", - "Georgia", "Times New Roman", "Andale Mono")) - ), - column(6, - selectInput("wcCol", "Text colors", - choices = c("Random Dark" = "random-dark", - "Random Light" = "random-light"), - selected = "random-dark") - )), - fluidRow(column(6, - numericInput("scale", label = "Font size", min=0.1,max=5,step=0.1,value=0.5) - ), - column(6, - numericInput("ellipticity", label = "Ellipticity", min=0,max=1,step=0.05,value=0.65) - )), - fluidRow(column(6, - numericInput("padding", label = "Padding", min = 0, max = 5, value = 1, step = 1) - ), - column(6, - numericInput("rotate", label = "Rotate", min = 0, max = 20, value = 0, step = 1) - )) - ) - ), - ## Tree Map ---- - conditionalPanel(condition = 'input.sidebarmenu == "treemap"', - selectInput("treeTerms", "Field", - choices = c("Keywords Plus" = "ID", - "Author's keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB", - "Subject Categories (WoS)" = "WC"), - selected = "ID"), - conditionalPanel(condition = "input.treeTerms == 'AB' |input.treeTerms == 'TI'", - selectInput("treeTermsngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - numericInput("treen_words", label = "Number of words", min = 10, max = 200, step = 5, value = 50), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("TreeMapStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TreeMapStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("TreeMapStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TreeMapSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TreeMapStopPreview")) - ), - selectInput("TreeMapSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TreeMapSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("TreeMapSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TreeMapSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TreeMapSynPreview")) - ) - ) - ), - ## Word dynamics ---- - conditionalPanel(condition = 'input.sidebarmenu == "wordDynamics"', - selectInput("growthTerms", "Field", - choices = c("Keywords Plus" = "ID", - "Author's keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.growthTerms == 'AB' |input.growthTerms == 'TI'", - selectInput("growthTermsngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("WDStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.WDStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("WDStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("WDSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("WDStopPreview")) - ), - selectInput("WDSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.WDSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("WDSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("WDSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("WDSynPreview")) - )), - br(), - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("cumTerms", "Occurrences", - choices = c("Cumulate" = "Cum", - "Per year" = "noCum"), - selected = "Cum"), - sliderInput("topkw", label = "Number of words", min = 1, max = 100, step = 1, value = c(1,10))), - br(), - selectInput( - 'WDdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.WDdpi != 'null'", - sliderInput( - 'WDh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("WDplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - - ) - ), - ## Trend Topic ---- - conditionalPanel(condition = 'input.sidebarmenu == "trendTopic"', - selectInput("trendTerms", "Field", - choices = c("Keywords Plus" = "ID", - "Author's keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.trendTerms == 'TI' | input.trendTerms == 'AB'", - selectInput("trendTermsngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - conditionalPanel( - condition = "input.trendTerms == 'TI' | input.trendTerms == 'AB'", - selectInput("trendStemming", label="Word Stemming", - choices = c("Yes" = TRUE, - "No" = FALSE), - selected = FALSE)), - uiOutput("trendSliderPY"), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("TTStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TTStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("TTStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TTSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TTStopPreview")) - ), - selectInput("TTSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TTSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("TTSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TTSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TTSynPreview")) - )), - br(), - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput("trendMinFreq", label = "Word Minimum Frequency", min = 0, max = 100, value = 5, step = 1), - ), - column(6, - numericInput("trendNItems", label = "Number of Words per Year", min = 1, max = 20, step = 1, value = 3) - ))), - br(), - selectInput( - 'TTdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.TTdpi != 'null'", - sliderInput( - 'TTh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("TTplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Coupling ---- - conditionalPanel(condition = 'input.sidebarmenu == "coupling"', - h4(em(strong(" "))), - " ", - selectInput("CManalysis", - label = "Unit of Analysis", - choices = c("Documents" = "documents", - "Authors" = "authors", - "Sources" = "sources"), - selected = "documents"), - " ", - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput("CMfield", - label = "Coupling measured by", - choices = c("References" ="CR", - "Keywords Plus" = "ID", - "Author's Keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB"), - selected = "CR"), - conditionalPanel(condition = "input.CMfield == 'TI' | input.CMfield == 'AB'", - selectInput("CMstemming", label="Word Stemming", - choices = c("Yes" = TRUE, - "No" = FALSE), - selected = FALSE)), - selectInput("CMimpact", - label = "Impact measure", - choices = c("Local Citation Score" = "local", - "Global Citation Score" = "global"), - selected = "local"), - selectInput("CMlabeling", - label = "Cluster labeling by", - choices = c("None" = "none", - "Keyword Plus" = "ID", - "Authors' keywords" = "DE", - "Title terms" = "TI", - "Abstract terms" = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.CMlabeling == 'TI' | input.CMlabeling == 'AB'", - selectInput("CMngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - fluidRow(column(6, - numericInput("CMn", label="Number of Units\n ",value=250,min=50,max=5000,step=1)), - column(6, - numericInput("CMfreq", label="Min Cluster Freq. ",value=5,min=1,max=100,step=1))), - fluidRow(column(6, - numericInput("CMn.labels", label="Labels per cluster",value=3,min=1,max=10,step=1)), - column(6, - numericInput("sizeCM", label="Label size",value=0.3,min=0.0,max=1,step=0.05))), - fluidRow(column(6, - numericInput("CMrepulsion", label="Community Repulsion",value=0,min=0,max=1,step=0.01)), - column(6, - selectInput("CMcluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - )) - ), - selectInput( - 'CMdpi', - h4(strong( - "Export plot" - )), - choices=c( - "Dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.CMdpi != 'null'", - sliderInput( - 'CMh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("CMplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Co-Occurence Network ---- - conditionalPanel(condition = 'input.sidebarmenu == "coOccurenceNetwork"', - selectInput("field", - "Field", - choices = c("Keywords Plus" = "ID", - "Author's Keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB", - "Subject Categories (WoS)" = "WC"), - selected = "ID"), - conditionalPanel(condition = "input.field == 'TI' | input.field == 'AB'", - selectInput("cocngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("COCStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.COCStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("COCStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("COCSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("COCStopPreview")) - ), - selectInput("COCSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.COCSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("COCSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("COCSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("COCSynPreview")) - )), - br(), - box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - selectInput("layout", - label = "Network Layout", - choices = c("Automatic layout"="auto", - "Circle"="circle", - "Fruchterman & Reingold"="fruchterman", - "Kamada & Kawai"="kamada", - "MultiDimensional Scaling"="mds", - "Sphere"="sphere", - "Star"="star"), - selected = "auto") - ), - column(6, - selectInput("cocCluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - )), - fluidRow(column(6, - selectInput("normalize", - label = "Normalization", - choices = c("none", - "association", - "jaccard", - "salton", - "inclusion", - "equivalence"), - selected = "association") - ), - column(6, - selectInput("cocyears", - label = "Node Color by Year", - choices = c("No" = "No", - "Yes"= "Yes"), - selected = "No") - ) - ), - fluidRow(column(6, - numericInput(inputId = "Nodes", - label = "Number of Nodes", - min = 5, - max = 1000, - value = 50, - step = 1) - ), - column(6, - numericInput(inputId = "coc.repulsion", - label = "Repulsion Force", - min = 0, - max = 1, - value = 0.1, - step = 0.1) - )), - fluidRow(column(6, - selectInput(inputId ="coc.isolates", - label = "Remove Isolated Nodes", - choices = c("Yes" = "yes", - "No" = "no"), - selected = "yes") - ), - column(6, - numericInput("edges.min", - label=("Minimum Number of Edges"), - value = 2, - step = 1, - min = 0) - ) - )), - br(), - box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput(inputId = "cocAlpha", - label = "Opacity", - min = 0, - max = 1, - value = 0.7, - step=0.05) - ), - column(6, - numericInput(inputId = "Labels", - label = "Number of labels", - min = 0, - max = 1000, - value = 1000, - step = 1) - )), - fluidRow(column(6, - selectInput(inputId ="label.cex", - label = "Label cex", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="coc.shape", - label = "Node Shape", - choices = c( - "Box"="box", - "Circle"="circle", - "Dot"="dot", - "Ellipse"="ellipse", - "Square"="square", - "Text"="text"), - selected = "dot") - )), - fluidRow(column(6, - numericInput(inputId = "labelsize", - label = "Label size", - min = 0.0, - max = 20, - value = 3, - step = 0.10) - ), - column(6, - numericInput( - inputId = "edgesize", - label = "Edge size", - min = 0.0, - max = 20, - value = 5, - step=0.5) - )), - fluidRow(column(6, - selectInput(inputId ="coc.shadow", - label = "Node shadow", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="coc.curved", - label = "Edit Nodes", - choices = c("Yes", - "No"), - selected = "No") - - ) - ) - ), - br(), - fluidRow(column(6, - downloadButton("network.coc", strong("Save Pajek"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - ), - column(6, - downloadButton("networkCoc.fig", strong("Save HTML"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - ) - ), - br(), - selectInput("cocRes", - h4(strong("Export plot")), - choices = c( - "Select the image scale" = 0, - "screen resolution x1" = 1, - "screen resolution x2" = 2, - "screen resolution x3" = 3, - "screen resolution x4" = 4, - "screen resolution x5" = 5, - "screen resolution x6" = 6, - "screen resolution x7" = 7, - "screen resolution x8" = 8 - ), - selected = 0), - conditionalPanel(condition = "input.cocRes != 0", - actionButton("cocPlot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Thematic Map ---- - conditionalPanel(condition = 'input.sidebarmenu == "thematicMap"', - h4(em(strong(" "))), - " ", - selectInput("TMfield", - label = "Field", - choices = c("Keywords Plus" = "ID", - "Author's Keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.TMfield == 'TI' | input.TMfield == 'AB'", - selectInput("TMngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - conditionalPanel( - condition = "input.TMfield == 'TI' | input.TMfield == 'AB'", - selectInput("TMstemming", label="Word Stemming", - choices = c("Yes" = TRUE, - "No" = FALSE), - selected = FALSE)), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("TMStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TMStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("TMStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TMSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TMStopPreview")) - ), - selectInput("TMapSynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TMapSynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("TMapSyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TMapSynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TMapSynPreview")) - )), - br(), - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput("TMn", label="Number of Words",value=250,min=50,max=5000,step=1) - ), - column(6, - numericInput("TMfreq", label="Min Cluster Frequency (per thousand docs)",value=5,min=1,max=100,step=1) - )), - fluidRow(column(6, - numericInput("TMn.labels", label="Number of Labels",value=3,min=0,max=10,step=1) - ), - column(6, - numericInput("sizeTM", label="Label size",value=0.3,min=0.0,max=1,step=0.05) - )), - fluidRow(column(6, - numericInput("TMrepulsion", label="Community Repulsion",value=0,min=0,max=1,step=0.01)), - column(6, - selectInput("TMCluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - ) - ) - ), - br(), - selectInput( - 'TMdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.TMdpi != 'null'", - sliderInput( - 'TMh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("TMplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Thematic Evolution ---- - conditionalPanel(condition = 'input.sidebarmenu == "thematicEvolution"', - h4(em(strong(" "))), - " ", - selectInput("TEfield", - label = "Field", - choices = c("Keywords Plus" = "ID", - "Author's Keywords" = "DE", - "Titles" = "TI", - "Abstracts - " = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.TEfield == 'TI' | input.TEfield == 'AB'", - selectInput("TEngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("TEStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TEStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("TEStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TESep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TEStopPreview")) - ), - selectInput("TESynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.TESynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("TESyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("TESynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("TESynPreview")) - )), - br(), - box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput("nTE", label="Number of Words",value=250,min=50,max=5000,step=1) - ), - column(6, - numericInput("fTE", label="Min Cluster Frequency (per thousand docs)",value=5,min=1,max=100,step=1) - )), - fluidRow(column(6, - selectInput("TEmeasure", - label = "Weight index", - choices = c("Inclusion Index" = "inclusion", - "Inclusion Index weighted by Word-Occurrences" = "weighted", - "Stability Index" = "stability" - ), - selected = "weighted") - ), - column(6, - numericInput("minFlowTE", label="Min Weight Index",value=0.1,min=0.02,max=1,step=0.02) - )), - fluidRow(column(6, - numericInput("sizeTE", label="Label size",value=0.3,min=0.0,max=1,step=0.05) - ), - column(6, - numericInput("TEn.labels", label="Number of Labels (for each cluster)",value=3,min=1,max=5,step=1) - )), - fluidRow(column(12, - selectInput("TECluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - ) - - ) - ), - br(), - box(title = p(strong("Time Slices"),style='font-size:16px;color:black;'), - collapsible = FALSE, width = 15, - solidHeader = FALSE, collapsed = FALSE, - numericInput("numSlices", label="Number of Cutting Points",min=1,max=4,value=1), - "Please, write the cutting points (in year) for your collection", - uiOutput("sliders") - ), - br(), - selectInput( - 'TEdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.TEdpi != 'null'", - sliderInput( - 'TEh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("TEplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Factorial Analysis ---- - conditionalPanel(condition = 'input.sidebarmenu == "factorialAnalysis"', - selectInput("method", - label = "Method", - choices = c("Correspondence Analysis" = "CA", - "Multiple Correspondence Analysis" = "MCA", - "Multidimensional Scaling"= "MDS"), - selected = "MCA"), - selectInput("CSfield", - label = "Field", - choices = c("Keywords Plus" = "ID", - "Author's Keywords" = "DE", - "Titles" = "TI", - "Abstracts" = "AB"), - selected = "ID"), - conditionalPanel(condition = "input.CSfield == 'TI' | input.CSfield == 'AB'", - selectInput("CSngrams",'N-Grams', - choices = c("Unigrams" = "1", - "Bigrams" = "2", - "Trigrams" = "3"), - selected = 1)), - br(), - box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - selectInput("CSStopFile", "Load a list of terms to remove", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.CSStopFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) - ), - fileInput("CSStop", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("CSSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("CSStopPreview")) - ), - selectInput("FASynFile", "Load a list of synonyms", - choices = c("Yes" = "Y", - "No" = "N"), - selected = "N"), - conditionalPanel(condition = "input.FASynFile == 'Y'", - helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), - h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). - Rows have to be separated by return separator.")) - ), - fileInput("FASyn", "", - multiple = FALSE, - accept = c("text/csv", - "text/comma-separated-values,text/plain", - ".csv", - ".txt")), - - selectInput("FASynSep", "File Separator", - choices = c('Comma ","' = ",", - 'Semicolon ";"' = ";", - 'Tab '= "\t"), - selected = ","), - h5(htmlOutput("FASynPreview")) - )), - br(), - box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput("CSn", - label=("Number of terms"), - value = 50, step = 1)), - column(6, - selectInput("nClustersCS", - label = "N. of Clusters", - choices = c("Auto" = "0", - "2" = "2", - "3" = "3", - "4" = "4", - "5" = "5", - "6" = "6", - "7" = "7", - "8" = "8"), - selected = "0"))) - ), - br(), - box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput( - inputId = "CSlabelsize", - label = "Label size", - min = 5, - max = 30, - value = 10)), - column(6, - numericInput("CSdoc", - label=("Num. of documents"), - value = 5))) - ), - br(), - selectInput( - 'FAdpi', - h4(strong( - "Export plots as png" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.FAdpi != 'null'", - sliderInput( - 'FAh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("FA1plot.save", strong("Term Factorial Map "), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - h4(" "), - downloadButton("FA2plot.save", strong("Topic Dendrogram "), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - h4(" "), - downloadButton("FA3plot.save", strong("Most Contributing Map "), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%"), - h4(" "), - downloadButton("FA4plot.save", strong("Most Cited Map "), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Co-citation Network ---- - conditionalPanel(condition = 'input.sidebarmenu == "coCitationNetwork"', - selectInput("citField", - label = "Field", - choices = c("Papers" = "CR", - "Authors" = "CR_AU", - "Sources" = "CR_SO"), - selected = "CR"), - selectInput(inputId = "citSep", - label = "Field separator character", - choices = c('";" (Semicolon)' = ";", - '". " (Dot and 3 or more spaces)' = ". ", - '"," (Comma)' = ","), - selected = "';'"), - br(), - box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - selectInput("citlayout", - label = "Network Layout", - choices = c("Automatic layout"="auto", - "Circle"="circle", - "Fruchterman & Reingold"="fruchterman", - "Kamada & Kawai"="kamada", - "MultiDimensional Scaling"="mds", - "Sphere"="sphere", - "Star"="star"), - selected = "auto") - ), - column(6, - selectInput("cocitCluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - )), - fluidRow(column(6, - numericInput(inputId = "citNodes", - label = "Number of Nodes", - min = 5, - max = 1000, - value = 50, - step = 1) - ), - column(6, - numericInput(inputId = "cocit.repulsion", - label = "Repulsion Force", - min = 0, - max = 1, - value = 0.1, - step = 0.1) - )), - fluidRow(column(6, - selectInput(inputId ="cit.isolates", - label = "Remove Isolated Nodes", - choices = c("Yes" = "yes", - "No" = "no"), - selected = "yes") - ), - column(6, - numericInput("citedges.min", - label=("Minimum Number of Edges"), - value = 2, - step = 1, - min = 0) - ) - )), - br(), - box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - selectInput(inputId ="citShortlabel", - label = "Short Label", - choices = c("Yes", - "No"), - selected = "Yes"), - - ), - column(6, - numericInput(inputId = "citLabels", - label = "Number of labels", - min = 0, - max = 1000, - value = 1000, - step = 1) - )), - fluidRow(column(6, - selectInput(inputId ="citlabel.cex", - label = "Label cex", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="cocit.shape", - label = "Node Shape", - choices = c( - "Box"="box", - "Circle"="circle", - "Dot"="dot", - "Ellipse"="ellipse", - "Square"="square", - "Text"="text"), - selected = "dot") - )), - fluidRow(column(6, - numericInput(inputId = "citlabelsize", - label = "Label size", - min = 0.0, - max = 20, - value = 2, - step = 0.10) - ), - column(6, - numericInput( - inputId = "citedgesize", - label = "Edge size", - min = 0.5, - max = 20, - value = 2, - step=0.5) - )), - fluidRow(column(6, - selectInput(inputId ="cocit.shadow", - label = "Node shadow", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="cocit.curved", - label = "Edit Nodes", - choices = c("Yes", - "No"), - selected = "No") - - ) - ) - ), - br(), - fluidRow(column(6, - downloadButton("network.cocit", strong("Save Pajek"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - ), - column(6, - downloadButton("networkCocit.fig", strong("Save HTML"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - )), - br(), - selectInput("cocitRes", - h4(strong("Export plot")), - choices = c( - "Select the image scale" = 0, - "screen resolution x1" = 1, - "screen resolution x2" = 2, - "screen resolution x3" = 3, - "screen resolution x4" = 4, - "screen resolution x5" = 5, - "screen resolution x6" = 6, - "screen resolution x7" = 7, - "screen resolution x8" = 8 - ), - selected = 0), - conditionalPanel(condition = "input.cocitRes != 0", - actionButton("cocitPlot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Historiograph ---- - conditionalPanel(condition = 'input.sidebarmenu == "historiograph"', - numericInput(inputId = "histNodes", - label = "Number of Nodes", - min = 5, - max = 100, - value = 20, - step = 1), - " ", - br(), - box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, - collapsed = FALSE, - selectInput(inputId = "titlelabel", - label = "Node label", - choices = c("Short id (1st Author, Year)" = "short", - "Document Title" = "title", - "Authors' Keywords" = "keywords", - "Keywords Plus" = "keywordsplus"), - selected = "short"), - fluidRow(column(6, - numericInput(inputId = "histlabelsize", - label = "Label size", - min = 0.0, - max = 20, - value = 3, step = 1)), - column(6, - numericInput(inputId = "histsize", - label = "Node size", - min = 0, - max = 20, - value = 4, step = 1))) - ), - br(), - selectInput("HGh", - h4(strong("Export plot")), - choices = c( - "Select the image scale" = 0, - "screen resolution x1" = 1, - "screen resolution x2" = 2, - "screen resolution x3" = 3, - "screen resolution x4" = 4, - "screen resolution x5" = 5, - "screen resolution x6" = 6, - "screen resolution x7" = 7, - "screen resolution x8" = 8 - ), - selected = 0), - conditionalPanel(condition = "input.HGh != 0", - actionButton("HGplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Collaboration Network ---- - conditionalPanel(condition = 'input.sidebarmenu == "collabNetwork"', - selectInput("colField", - label = "Field", - choices = c("Authors" = "COL_AU", - "Institutions" = "COL_UN", - "Countries" = "COL_CO"), - selected = "COL_AU"), - br(), - box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - selectInput("collayout", - label = "Network Layout", - choices = c("Automatic layout"="auto", - "Circle"="circle", - "Fruchterman & Reingold"="fruchterman", - "Kamada & Kawai"="kamada", - "MultiDimensional Scaling"="mds", - "Sphere"="sphere", - "Star"="star"), - selected = "auto") - ), - column(6, - selectInput("colCluster", - label = "Clustering Algorithm", - choices = c("None" = "none", - "Edge Betweenness" = "edge_betweenness", - "Fast Greedy" = "fast_greedy", - "InfoMap" = "infomap", - "Leading Eigenvalues" = "leading_eigen", - "Leiden" = "leiden", - "Louvain" = "louvain", - "Spinglass" = "spinglass", - "Walktrap" = "walktrap"), - selected = "walktrap") - )), - fluidRow(column(6, - selectInput("colnormalize", - label = "Normalization", - choices = c("none", - "association", - "jaccard", - "salton", - "inclusion", - "equivalence"), - selected = "association") - )), - fluidRow(column(6, - numericInput(inputId = "colNodes", - label = "Number of Nodes", - min = 5, - max = 1000, - value = 50, - step = 1) - ), - column(6, - numericInput(inputId = "col.repulsion", - label = "Repulsion Force", - min = 0, - max = 1, - value = 0.1, - step = 0.1) - )), - fluidRow(column(6, - selectInput(inputId ="col.isolates", - label = "Remove Isolated Nodes", - choices = c("Yes" = "yes", - "No" = "no"), - selected = "yes") - ), - column(6, - numericInput("coledges.min", - label=("Minimum Number of Edges"), - value = 1, - step = 1, - min = 0) - ) - )), - br(), - box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), - collapsible = TRUE, width = 15, - solidHeader = FALSE, collapsed = TRUE, - fluidRow(column(6, - numericInput(inputId = "colAlpha", - label = "Opacity", - min = 0, - max = 1, - value = 0.7, - step=0.05) - ), - column(6, - numericInput(inputId = "colLabels", - label = "Number of labels", - min = 0, - max = 1000, - value = 1000, - step = 1) - )), - fluidRow(column(6, - selectInput(inputId ="collabel.cex", - label = "Label cex", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="col.shape", - label = "Node Shape", - choices = c( - "Box"="box", - "Circle"="circle", - "Dot"="dot", - "Ellipse"="ellipse", - "Square"="square", - "Text"="text"), - selected = "dot") - )), - fluidRow(column(6, - numericInput(inputId = "collabelsize", - label = "Label size", - min = 0.0, - max = 20, - value = 2, - step = 0.10) - ), - column(6, - numericInput( - inputId = "coledgesize", - label = "Edge size", - min = 0.5, - max = 20, - value = 5, - step=0.5) - )), - fluidRow(column(6, - selectInput(inputId ="col.shadow", - label = "Node shadow", - choices = c("Yes", - "No"), - selected = "Yes") - ), - column(6, - selectInput(inputId ="soc.curved", - label = "Edit Nodes", - choices = c("Yes", - "No"), - selected = "No") - - )) - ), - br(), - fluidRow(column(6, - downloadButton("network.col", strong("Save Pajek"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - ), - column(6, - downloadButton("networkCol.fig", strong("Save HTML"), - style ="border-radius: 10px; border-width: 3px;font-size: 15px;", - width = "100%") - )), - br(), - selectInput("colRes", - h4(strong("Export plot")), - choices = c( - "Select the image scale" = 0, - "screen resolution x1" = 1, - "screen resolution x2" = 2, - "screen resolution x3" = 3, - "screen resolution x4" = 4, - "screen resolution x5" = 5, - "screen resolution x6" = 6, - "screen resolution x7" = 7, - "screen resolution x8" = 8 - ), - selected = 0), - conditionalPanel(condition = "input.colRes != 0", - actionButton("colPlot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ), - ## Collaboration World Map ---- - conditionalPanel(condition = 'input.sidebarmenu == "collabWorldMap"', - h4(strong("Method Parameters: ")), - " ", - numericInput("WMedges.min", - label=("Min edges"), - value = 2, - step = 1), - " ", - br(), - h4(strong("Graphical Parameters: ")), - " ", - sliderInput(inputId = "WMedgesize", - label = "Edge size", - min = 0.1, - max = 20, - value = 5), - br(), - selectInput( - 'CCdpi', - h4(strong( - "Export plot" - )), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - conditionalPanel(condition = "input.CCdpi != 'null'", - sliderInput( - 'CCh', - h4(em(strong( - "Height (in inches)" - ))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("CCplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px;font-size: 20px;", - width = "100%") - ) - ) - ) - ) - ) - ) + observeEvent(input$screenWC,{ + screenshot( + filename = paste("WordCloud-", Sys.Date(), ".png", sep=""), + id = "wordcloud", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL ) }) + + observeEvent(input$screenTREEMAP,{ + screenshot( + filename = paste("TreeMap-", Sys.Date(), ".png", sep=""), + id = "treemap", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) + }) + + observeEvent(input$screenCOC,{ + screenshot( + filename = paste("Co_occurrenceNetwork-", Sys.Date(), ".png", sep=""), + id = "cocPlot", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) + }) + + observeEvent(input$screenCOCIT,{ + screenshot( + filename = paste("Co_citationNetwork-", Sys.Date(), ".png", sep=""), + id = "cocitPlot", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) + }) + + observeEvent(input$screenHIST,{ + screenshot( + filename = paste("Historiograph-", Sys.Date(), ".png", sep=""), + id = "histPlotVis", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) + }) + + observeEvent(input$screenCOL,{ + screenshot( + filename = paste("Collaboration_Network-", Sys.Date(), ".png", sep=""), + id = "colPlot", + scale = 1, + timer = 0, + download = TRUE, + server_dir = NULL + ) + }) + + + ### settings ---- + observeEvent(input$dpi, { + values$dpi <- as.numeric(input$dpi) + }) + + observeEvent(input$h,{ + values$h <- as.numeric(input$h) + }) + } diff --git a/inst/biblioshiny/ui.R b/inst/biblioshiny/ui.R index 71c0ea96..f7b9970d 100644 --- a/inst/biblioshiny/ui.R +++ b/inst/biblioshiny/ui.R @@ -8,37 +8,61 @@ mytitle <- tags$link(tags$a(href = 'https://www.bibliometrix.org/',target="_blan strong("bibliometrix") ) -intro <- "javascript:void(window.open('https://www.bibliometrix.org/vignettes/Introduction_to_bibliometrix.html', '_blank'))" -importData <- "javascript:void(window.open('https://www.bibliometrix.org/vignettes/Data-Importing-and-Converting.html', '_blank'))" -slides <- "javascript:void(window.open('https://bibliometrix.org/biblioshiny/assets/player/KeynoteDHTMLPlayer.html#0', '_blank'))" -donation <- "javascript:void(window.open('https://www.bibliometrix.org/home/index.php/donation', '_blank'))" -bibliometrixWeb <- "javascript:void(window.open('https://www.bibliometrix.org/', '_blank'))" -k_synth <- "javascript:void(window.open('https://www.k-synth.unina.it', '_blank'))" -github_aria <- "javascript:void(window.open('https://github.com/massimoaria/bibliometrix', '_blank'))" +intro <- 'https://www.bibliometrix.org/vignettes/Introduction_to_bibliometrix.html' +importData <- 'https://www.bibliometrix.org/vignettes/Data-Importing-and-Converting.html' +slides <- 'https://bibliometrix.org/biblioshiny/assets/player/KeynoteDHTMLPlayer.html#0' +donation <- 'https://www.bibliometrix.org/home/index.php/donation' +bibliometrixWeb <- 'https://www.bibliometrix.org/' +k_synth <- 'https://www.k-synth.unina.it' +github_aria <- 'https://github.com/massimoaria/bibliometrix' + +style_opt <- "border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;" # (option button) +style_bttn <- "border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;" # (action buttons) +t_report <- "Add Results to the Report" +t_export <- "Export Plot as PNG" +t_run <- "Run the Analysis" +run_bttn <- list( + label = NULL, + style = "material-circle", + color = "primary", + icon = icon(name ="play", lib="glyphicon") +) +report_bttn <- list( + label = NULL, + style = "material-circle", + color = "primary", + icon = icon(name ="plus", lib="glyphicon") +) +export_bttn <- list( + label=NULL, + style = "material-circle", + color = "primary", + icon = icon(name ="download", lib="glyphicon") +) ## Header ---- header <- shinydashboardPlus::dashboardHeader(title = mytitle, titleWidth = 300, - controlbarIcon = fa_i(name ="bars"), + #controlbarIcon = fa_i(name ="bars"), dropdownMenuOutput("notificationMenu"), dropdownMenu( type = "messages", icon = icon("question"), badgeStatus = NULL, headerText = strong("Help Menu"), - messageItem( + messageItem2( from = "Package Tutorial", message = "", href = intro, icon = icon("play-circle", lib = "glyphicon") ), - messageItem( + messageItem2( from = "Convert and Import Data", message = "", icon = icon("info-sign", lib = "glyphicon"), href = importData ), - messageItem( + messageItem2( icon = icon("play", lib = "glyphicon"), from = "biblioshiny Tutorial", message = "", @@ -49,7 +73,7 @@ header <- shinydashboardPlus::dashboardHeader(title = mytitle, icon = icon("comment-dollar", lib = "font-awesome"), badgeStatus = NULL, headerText = strong("Donate"), - messageItem( + messageItem2( from = "Donation", message = "", href = donation, @@ -61,26 +85,26 @@ header <- shinydashboardPlus::dashboardHeader(title = mytitle, icon = fa_i(name="cube"), badgeStatus = NULL, headerText = strong("Credits"), - messageItem( + messageItem2( from = "Bibliometrix", message = "", href = bibliometrixWeb, icon = fa_i(name = "globe") ), - messageItem( + messageItem2( from = "K-Synth", message = "", href = k_synth, icon = fa_i(name = "watchman-monitoring") ), - messageItem( + messageItem2( from = "Github", message = "", href = github_aria, icon = fa_i(name = "github") ) - ), - tags$li(class = "dropdown", + ) + ,tags$li(class = "dropdown", tags$style(".main-header .logo {height: 53px}") ) ) @@ -156,7 +180,7 @@ body <- dashboardBody( div(p("For an introduction and live examples, visit the ", em(a("bibliometrix website.", href = "https://www.bibliometrix.org", target="_blank")), - style="text-align:center; font-size:20px;")), + style="text-align:center; font-size:20px;")) ) ) ) @@ -166,22 +190,125 @@ body <- dashboardBody( tabItem("loadData", fluidPage( fluidRow( - tags$head(tags$style( - HTML( - "table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { + div( + tags$head(tags$style( + HTML( + "table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { background-color: #9c4242 !important; } " - ) - )), - tags$style( - HTML( - ".dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate .paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { + ) + )), + tags$style( + HTML( + ".dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate .paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: #000000 !important; }" + ) + ), + column(9, + shinycssloaders::withSpinner(DT::DTOutput("contents"))), + column(3, + fluidRow( + box( + width = "100%", + h3(strong("Import or Load ")), + selectInput("load", label = "Please, choose what to do", + choices = c( + " " = "null", + "Import raw file(s)" = "import", + "Load bibliometrix file(s)" = "load", + "Use a sample collection" = "demo" + ), + selected = "null" + ), + conditionalPanel( + condition = "input.load == 'demo'", + helpText(h4(strong("The use of bibliometric approaches in business and management disciplines.")), + h5(strong("Dataset 'Management'")), + em("A collection of scientific articles about the use of bibliometric approaches", + "in business and management disciplines."), + br(), + em("Period: 1985 - 2020 + , Source WoS.")) + ), + conditionalPanel( + condition = "input.load == 'import'", + selectInput( + "dbsource", + label = "Database", + choices = c( + "Web of Science (WoS/WoK)" = "isi", + "Scopus" = "scopus", + "Dimensions" = "dimensions", + "Lens.org" = "lens", + "PubMed" = "pubmed", + "Cochrane Library" = "cochrane" + ), + selected = "isi" + ) + ), + conditionalPanel( + condition = "input.load != 'null' & input.load != 'demo'", + conditionalPanel( + condition = "input.load == 'load'", + helpText(em("Load a collection in XLSX or R format previously exported from bibliometrix") + )), + fileInput( + "file1", + "Choose a file", + multiple = FALSE, + accept = c( + ".csv", + ".txt", + ".ciw", + ".bib", + ".xlsx", + ".zip", + ".xls", + ".rdata", + ".rda", + ".rds" + ) + ) + ), + conditionalPanel(condition = "input.load != 'null'", + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 15px;", + align = "center", + width="100%", + actionBttn(inputId = "applyLoad", label = strong("Start"), + width = "100%", style = "pill", color = "primary", + icon = icon(name ="play", lib="glyphicon"))))) + ), + tags$hr(), + uiOutput("textLog"), + tags$hr(), + h3(strong( + "Export collection" + )), + selectInput( + 'save_file', + 'Save as:', + choices = c( + ' ' = 'null', + 'Excel' = 'xlsx', + 'R Data Format' = 'RData' + ), + selected = 'null' + ), + conditionalPanel(condition = "input.save_file != 'null'", + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 15px;", + align = "center", + width="100%", + downloadBttn(outputId = "collection.save", label = strong("Export"), + #width = "100%", + style = "pill", color = "primary")))) + ) + ) + ) ) - ), - shinycssloaders::withSpinner(DT::DTOutput("contents") ) ) ) @@ -196,36 +323,142 @@ body <- dashboardBody( background-color: #9c4242 !important; } " - ) - ) - ), + ))), tags$style( HTML( ".dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate .paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: #000000 !important; }" - ) - ), - shinycssloaders::withSpinner(DT::DTOutput("apiContents")) + )), + column(9,shinycssloaders::withSpinner(DT::DTOutput("apiContents"))), + column(3, + box( + width = "100%", + h3(strong( + "Gather data using APIs " + )), + br(), + selectInput( + "dbapi", + label = "Database", + choices = c("DS Dimensions" = "ds", + "PubMed" = "pubmed"), + selected = "pubmed" + ), + ## Dimenions API + conditionalPanel( + condition = "input.dbapi == 'ds'", + br(), + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + actionBttn(inputId = "dsShow", label ="1. Configure API", + style = "pill", color = "primary", + icon = icon(name ="sliders"))))), + #h5(tags$b("Your Query")), + verbatimTextOutput("queryLog2", placeholder = FALSE), + h5(tags$b("Documents returned using your query")), + verbatimTextOutput("sampleLog2", placeholder = FALSE) + ), + ### Pubmed API + conditionalPanel( + condition = "input.dbapi == 'pubmed'", + br(), + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + actionBttn(inputId = "pmShow", label ="1. Configure API", + style = "pill", color = "primary", + icon = icon(name ="sliders"))))), + #h5(tags$b("Your Query")), + verbatimTextOutput("pmQueryLog2", placeholder = FALSE), + h5(tags$b("Documents returned using your query")), + verbatimTextOutput("pmSampleLog2", placeholder = FALSE), + ), + tags$hr(), + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + actionBttn(inputId = "apiApply", label = "2. Download", + style = "pill", color = "primary", + icon(name ="download"))))), + tags$hr(), + h3(strong("Export a bibliometrix file ")), + br(), + selectInput( + 'save_file_api', + 'Save as:', + choices = c( + ' ' = 'null', + 'Excel' = 'xlsx', + 'R Data Format' = 'RData' + ), + selected = 'null' + ), + conditionalPanel(condition = "input.save_file_api != 'null'", + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 15px;", + align = "center", + width="100%", + downloadBttn(outputId = "collection.save_api", label = strong("Export"), + style = "pill", color = "primary")))) + ) + ) + + ) ) ) ), #### Filters ---- tabItem("filters", fluidRow( - DT::DTOutput("dataFiltered")) + column(9,DT::DTOutput("dataFiltered")), + column(3, + box( + width = "100%", + h3(strong("Filters")), + br(), + fluidRow(column(12, + div(style ="border-radius: 10px; border-width: 3px; font-size: 15px;", + align = "center", + width="100%", + actionBttn(inputId = "applyFilter", label = strong("Apply"), + width = "100%", style = "pill", color = "primary", + icon = icon(name ="play", lib="glyphicon"))))), + h5(" "), + box(h6(htmlOutput("textDim")), + width = "100%"), + br(), + uiOutput("selectLA"), + uiOutput("sliderPY"), + uiOutput("selectType"), + uiOutput("sliderTCpY"), + selectInput("bradfordSources", + label = "Source by Bradford Law Zones", + choices = c("Core Sources"="core", + "Core + Zone 2 Sources"="zone2", + "All Sources"="all"), + selected = "all") + ) + ) + ) ), #### Overview ---- ##### main information ---- tabItem("mainInfo", fluidPage( - fluidRow(column(10, - h2(strong("Main Information"), align = "center")), - column(2, - actionButton("reportMI", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 20px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ) + fluidRow(column(11, + h3(strong("Main Information"), align = "center")), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMI") + )) + )) ), fluidRow( tabsetPanel(type = "tabs", id = "maininfo", @@ -260,52 +493,22 @@ body <- dashboardBody( ##### annual scientific production ---- tabItem("annualScPr", fluidPage( - fluidRow(column(9, - h2(strong("Annual Scientific Production"), align = "center")), - column(2, - actionButton("reportASP", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 20px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ), - column(1, - br(), - ## dropdown options - dropdown( - h4(strong("Annual Growth Rate")), - br(), - verbatimTextOutput("CAGR", placeholder = TRUE), - br(), - selectInput( - 'ASPdpi', - label = h4(strong("Export plot")), - choices=c( - "dpi value" = "null", - "75 dpi" = "75", - "150 dpi" = "150", - "300 dpi" = "300", - "600 dpi" = "600" - ), - selected = "null" - ), - br(), - conditionalPanel(condition = 'input.ASPdpi != "null"', - sliderInput( - 'ASPh', - label =h4(em(strong("Height (in inches)"))), - value = 7, min = 1, max = 20, step = 1), - downloadButton("ASPplot.save", strong("Export plot as png"), - style ="border-radius: 10px; border-width: 3px; vertical-align: 'middle';font-size: 20px;", - width = "100%") - ), - right = TRUE, - animate = TRUE, - style = "unite", icon = icon("cog",lib="glyphicon"), - width = "300px", - tooltip = "Options"#, - #showOnCreate = TRUE - ) - # End Dropdown options - ) + fluidRow(column(10, + h3(strong("Annual Scientific Production"), align = "center")), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportASP") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "ASPplot.save") + )) + )) ), fluidRow( tabsetPanel(id ="tabsASP", @@ -324,12 +527,21 @@ body <- dashboardBody( tabItem("averageCitPerYear", fluidPage( fluidRow(column(10, - h2(strong("Average Citations Per Year"), align = "center")), - column(2, - actionButton("reportACpY", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 20px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ) + h3(strong("Average Citations Per Year"), align = "center")), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportACpY") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "ACpYplot.save") + )) + )) ), fluidRow( tabsetPanel(type = "tabs", @@ -347,23 +559,96 @@ body <- dashboardBody( tabItem("threeFieldPlot", fluidPage( fluidRow( - column(6, - h2(strong("Three-Field Plot"), align = "center")), - column(2, - actionButton("apply3F", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name ="play"))), - column(2, - actionButton("reportTFP", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ), - column(2, - screenshotButton(label=strong("Export"), id = "ThreeFieldsPlot", - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - scale = 2, width = "80%", - file=paste("ThreeFieldPlot-", Sys.Date(), ".png", sep="")) - ) + column(8, + h3(strong("Three-Field Plot"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "apply3F") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportTFP") + )) + )), + div(style = style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenTFP") + )) + )), + div(style = style_opt, + column(1, + dropdown( + box(title = h4(strong("Parameters")), + collapsible = FALSE, + width = 15, + solidHeader = FALSE, + fluidRow( + column(6, selectInput("CentralField", + label = "Middle Field", + choices = c("Authors" = "AU", + "Affiliations" = "AU_UN", + "Countries"="AU_CO", + "Keywords" = "DE", + "Keywords Plus" = "ID", + "Titles" = "TI_TM", + "Abstract" = "AB_TM", + "Sources" = "SO", + "References" = "CR", + "Cited Sources" = "CR_SO"), + selected = "AU")), + column(6,numericInput("CentralFieldn", + label=("Number of items"), + min = 1, max = 50, step = 1, value = 20))), + fluidRow( + column(6,selectInput("LeftField", + label = "Left Field", + choices = c("Authors" = "AU", + "Affiliations" = "AU_UN", + "Countries"="AU_CO", + "Keywords" = "DE", + "Keywords Plus" = "ID", + "Titles" = "TI_TM", + "Abstract" = "AB_TM", + "Sources" = "SO", + "References" = "CR", + "Cited Sources" = "CR_SO"), + selected = "CR")), + column(6, numericInput("LeftFieldn", + label=("Number of items"), + min = 1, max = 50, step = 1, value = 20))), + fluidRow( + column(6,selectInput("RightField", + label = "Right Field", + choices = c("Authors" = "AU", + "Affiliations" = "AU_UN", + "Countries"="AU_CO", + "Keywords" = "DE", + "Keywords Plus" = "ID", + "Titles" = "TI_TM", + "Abstract" = "AB_TM", + "Sources" = "SO", + "References" = "CR", + "Cited Sources" = "CR_SO"), + selected = "DE")), + column(6,numericInput("RightFieldn", + label=("Number of items"), + min = 1, max = 50, step = 1, value = 20))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + )) + ) ), fluidRow( shinycssloaders::withSpinner(plotlyOutput(outputId = "ThreeFieldsPlot", height = "90vh")) @@ -376,14 +661,47 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Relevant Sources"), align = "center")), - column(2,actionButton("applyMRSources", strong("Run"),style ="border-radius: 10px; border-width: 3px;font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMRS", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Relevant Sources"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMRSources") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMRS") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MRSplot.save") + )) + )), + + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostRelSourcesK", + label=("Number of Sources"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) + ), fluidRow( tabsetPanel(type = "tabs", @@ -402,14 +720,45 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Local Cited Sources"), align = "center")), - column(2, - actionButton("applyMLCSources", strong("Run"),style ="border-radius: 10px; border-width: 3px;font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMLS", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Local Cited Sources"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMLCSources") + )) + )), + + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMLS") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MLCSplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostRelCitSourcesK", + label=("Number of Sources"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -429,15 +778,22 @@ body <- dashboardBody( fluidPage( fluidRow(column(10, #titlePanel( - h2(strong("Core Sources by Bradford's Law"), align = "center") + h3(strong("Core Sources by Bradford's Law"), align = "center") ), - column(2, - actionButton("reportBradford", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ) - - #) + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportBradford") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "BLplot.save") + )) + )) ), fluidRow( tabsetPanel(type = "tabs", @@ -456,15 +812,52 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Sources' Local Impact"), align = "center")), - column(2, - actionButton("applyHsource", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name ="play"))), - column(2, - actionButton("reportSI", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Sources' Local Impact"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyHsource") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportSI") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "SIplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("HmeasureSources", + label = "Impact measure", + choices = c("H-Index"="h", + "G-Index"="g", + "M-Index"="m", + "Total Citation"="tc"), + selected = "h"), + br(), + numericInput("Hksource", + label=("Number of sources"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -484,15 +877,48 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Sources' Production over Time"), align = "center")), - column(2,actionButton("applySOGrowth", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name ="play")) + h3(strong("Sources' Production over Time"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applySOGrowth") + )) + )), + + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportSD") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "SDplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("cumSO", "Occurrences", + choices = c("Cumulate" = "Cum", + "Per year" = "noCum"), + selected = "Cum"), + sliderInput("topSO", label = "Number of Sources", + min = 1, max = 50, step = 1, value = c(1,5)), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) ), - column(2, - actionButton("reportSD", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + style = style_opt ) ), fluidRow( @@ -513,14 +939,51 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Relevant Authors"), align = "center")), - column(2, - actionButton("applyMRAuthors", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMRA", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Relevant Authors"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMRAuthors") + )) + )), + + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMRA") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MRAplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostRelAuthorsK", + label=("Number of Authors"), + value = 10), + selectInput("AuFreqMeasure", + label = "Frequency measure", + choices = c("N. of Documents "="t", + "Percentage"="p", + "Fractionalized Frequency"="f"), + selected = "t"), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -540,13 +1003,45 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Local Cited Authors"), align = "center")), - column(2,actionButton("applyMLCAuthors", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMLCA", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Local Cited Authors"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMLCAuthors") + )) + )), + + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMLCA") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MLCAplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostCitAuthorsK", + label=("Number of Authors"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -566,15 +1061,43 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Authors' Production over Time"), align = "center")), - column(2, - actionButton("applyAUoverTime", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportAPOT", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Authors' Production over Time"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyAUoverTime") + )) + )),div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportAPOT") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "APOTplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("TopAuthorsProdK", + label=("Number of Authors"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -597,13 +1120,22 @@ body <- dashboardBody( fluidPage( fluidRow( column(10, - h2(strong("Author Productivity through Lotka's Law"), align = "center") + h3(strong("Author Productivity through Lotka's Law"), align = "center") ), - column(2, - actionButton("reportLotka", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ) + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportLotka") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "LLplot.save") + )) + )) ), fluidRow( tabsetPanel(type = "tabs", @@ -622,15 +1154,51 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Authors' Local Impact"), align = "center")), - column(2, - actionButton("applyHAuthors", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play")) + h3(strong("Authors' Local Impact"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyHAuthors") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportAI") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "AIplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("HmeasureAuthors", + label = "Impact measure", + choices = c("H-Index"="h", + "G-Index"="g", + "M-Index"="m", + "Total Citation"="tc"), + selected = "h"), + numericInput("Hkauthor", + label=("Number of authors"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) ), - column(2, - actionButton("reportAI", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + style = style_opt ) ), fluidRow( @@ -650,15 +1218,49 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Relevant Affiliations"), align = "center")), - column(2, - actionButton("applyMRAffiliations", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMRAFF", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Relevant Affiliations"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMRAffiliations") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMRAFF") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "AFFplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("disAff", + label = "Affiliation Name Disambiguation", + choices = c("Yes"="Y", + "No"="N"), + selected = "Y"), + numericInput("MostRelAffiliationsK", + label=("Number of Affiliations"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -678,15 +1280,43 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Affiliations' Production over Time"), align = "center")), - column(2,actionButton("applyAFFGrowth", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name ="play")) + h3(strong("Affiliations' Production over Time"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyAFFGrowth") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportAFFPOT") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "AffOverTimeplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("topAFF", label = "Number of Affiliations", + min = 1, max = 50, step = 1, value = 5), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) ), - column(2, - actionButton("reportAFFPOT", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + style = style_opt ) ), fluidRow( @@ -706,14 +1336,44 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Corresponding Author's Countries"), align = "center")), - column(2, - actionButton("applyCAUCountries", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMRCO", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Corresponding Author's Countries"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCAUCountries") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMRCO") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MRCOplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostRelCountriesK", + label=("Number of Countries"), + value = 20, min = 1, max = 50), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -732,12 +1392,21 @@ body <- dashboardBody( tabItem("countryScientProd", fluidPage( fluidRow(column(10, - h2(strong("Countries' Scientific Production"), align = "center")), - column(2, - actionButton("reportCSP", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) - ) + h3(strong("Countries' Scientific Production"), align = "center")), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCSP") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "CSPplot.save") + )) + )) ), fluidRow( tabsetPanel(type = "tabs", @@ -756,15 +1425,43 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Countries' Production over Time"), align = "center")), - column(2,actionButton("applyCOGrowth", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name ="play")) + h3(strong("Countries' Production over Time"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCOGrowth") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCPOT") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "CountryOverTimeplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + sliderInput("topCO", label = "Number of Countries", + min = 1, max = 50, step = 1, value = 5), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) ), - column(2, - actionButton("reportCPOT", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + style = style_opt ) ), fluidRow( @@ -784,13 +1481,49 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Cited Countries"), align = "center")), - column(2,actionButton("applyMCCountries", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMCCO", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Cited Countries"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMCCountries") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMCCO") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MCCplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("CitCountriesMeasure", + label = "Measure", + choices = c("Total Citations"="TC", + "Average Citations per Year"="TCY"), + selected = "TC"), + numericInput("MostCitCountriesK", + label=("Number of Countries"), + value = 10), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -811,15 +1544,49 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Global Cited Documents"), align = "center")), - column(2, - actionButton("applyMGCDocuments", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMCD", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Global Cited Documents"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMGCDocuments") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMCD") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MGCDplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostCitDocsK", + label=("Number of Documents"), + value = 10), + selectInput("CitDocsMeasure", + label = "Measure", + choices = c("Total Citations"="TC", + "Total Citations per Year"="TCY"), + selected = "TC"), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -839,15 +1606,50 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Local Cited Documents"), align = "center")), - column(2, actionButton("applyMLCDocuments", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = fa_i(name="play"))), - column(2, - actionButton("reportMLCD", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Local Cited Documents"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMLCDocuments") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMLCD") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MLCDplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostLocCitDocsK", + label=("Number of Documents"), + value = 10), + selectInput(inputId = "LocCitSep", + label = "Field separator character", + choices = c(";" = ";", + ". " = ". ", + "," = ","), + selected = ";"), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -867,15 +1669,50 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Local Cited References"), align = "center")), - column(2, - actionButton("applyMLCReferences", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportMLCR", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Most Local Cited References"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMLCReferences") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMLCR") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MLCRplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput("MostCitRefsK", + label=("Number of Documents"), + value = 10), + selectInput(inputId = "CitRefsSep", + label = "Field separator character", + choices = c(";" = ";", + ". " = ". ", + "," = ","), + selected = ";"), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -895,15 +1732,60 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Reference Spectroscopy"), align = "center") + h3(strong("Reference Spectroscopy"), align = "center") ), - column(2, - actionButton("applyRPYS", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportRPYS", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyRPYS") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportRPYS") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "RSplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput(inputId = "rpysSep", + label = "Field separator character", + choices = c(";" = ";", + ". " = ". ", + "," = ","), + selected = ";"), + h4(em(strong("Time slice"))), + fluidRow(column(6, + numericInput(inputId = "rpysMinYear", + label = "Starting Year", + value = NA, + step = 1)), + column(6, + numericInput(inputId = "rpysMaxYear", + label = "End Year", + value = NA, + step = 1) + )), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -925,17 +1807,105 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Most Frequent Words"), align = "center") + h3(strong("Most Frequent Words"), align = "center") ), - column(2, - actionButton("applyMFWords", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play")) - ), - column(2, - actionButton("reportMFW", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyMFWords") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportMFW") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "MRWplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("MostRelWords", "Field", + choices = c("Keywords Plus" = "ID", + "Author's keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB", + "Subject Categories (WoS)" = "WC"), + selected = "ID"), + conditionalPanel(condition = "input.MostRelWords == 'AB' |input.MostRelWords == 'TI'", + selectInput("MRWngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + numericInput("MostRelWordsN", label = "Number of words", min = 2, max = 100, step = 1, value = 10), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("MostRelWordsStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.MostRelWordsStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("MostRelWordsStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("MostRelWordsSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("MostRelWordsStopPreview")) + ), + selectInput("MRWSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.MRWSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("MRWSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("MRWSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("MRWSynPreview")) + )), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -956,14 +1926,149 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("WordCloud"), align = "center")), - column(2,actionButton("applyWordCloud", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportWC", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("WordCloud"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyWordCloud") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportWC") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenWC") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("summaryTerms", "Field", + choices = c("Keywords Plus" = "ID", + "Author's keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB", + "Subject Categories (WoS)" = "WC"), + selected = "ID"), + conditionalPanel(condition = "input.summaryTerms == 'AB' |input.summaryTerms == 'TI'", + selectInput("summaryTermsngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + numericInput("n_words", label = "Number of words", min = 10, max = 500, step = 1, value = 50), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("WCStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.WCStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("WCStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + selectInput("WCSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ",") + ), + selectInput("WCSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.WCSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("WCSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("WCSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ",") + )), + br(), + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + selectInput("measure", "Word occurrence by", + choices = c("Frequency" = "freq", + "Square root" = "sqrt", + "Log" = "log", + "Log10" = "log10"), + selected = "freq") + ), + column(6, + selectInput("wcShape", "Shape", + choices = c("Circle" = "circle", + "Cardiod" = "cardioid", + "Diamond" = "diamond", + "Pentagon" = "pentagon", + "Star" = "star", + "Triangle-forward" = "triangle-forward" + ,"Triangle" = "triangle"), + selected = "circle") + )), + fluidRow(column(6, + selectInput("font", label = "Font type", + choices = c("Impact", "Comic Sans MS (No plz!)" = "Comic Sans MS", + "Arial", "Arial Black", "Tahoma", "Verdana", "Courier New", + "Georgia", "Times New Roman", "Andale Mono")) + ), + column(6, + selectInput("wcCol", "Text colors", + choices = c("Random Dark" = "random-dark", + "Random Light" = "random-light"), + selected = "random-dark") + )), + fluidRow(column(6, + numericInput("scale", label = "Font size", min=0.1,max=5,step=0.1,value=0.5) + ), + column(6, + numericInput("ellipticity", label = "Ellipticity", min=0,max=1,step=0.05,value=0.65) + )), + fluidRow(column(6, + numericInput("padding", label = "Padding", min = 0, max = 5, value = 1, step = 1) + ), + column(6, + numericInput("rotate", label = "Rotate", min = 0, max = 20, value = 0, step = 1) + )) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -984,15 +2089,105 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("TreeMap"), align = "center")), - column(2, - actionButton("applyTreeMap", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportTREEMAP", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("TreeMap"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyTreeMap") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportTREEMAP") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenTREEMAP") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("treeTerms", "Field", + choices = c("Keywords Plus" = "ID", + "Author's keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB", + "Subject Categories (WoS)" = "WC"), + selected = "ID"), + conditionalPanel(condition = "input.treeTerms == 'AB' |input.treeTerms == 'TI'", + selectInput("treeTermsngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + numericInput("treen_words", label = "Number of words", min = 10, max = 200, step = 5, value = 50), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("TreeMapStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TreeMapStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("TreeMapStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TreeMapSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TreeMapStopPreview")) + ), + selectInput("TreeMapSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TreeMapSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("TreeMapSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TreeMapSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TreeMapSynPreview")) + ) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1012,15 +2207,112 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Words' Frequency over Time"), align = "center")), - column(2, - actionButton("applyWD", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportWD", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Words' Frequency over Time"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyWD") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportWD") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "WDplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("growthTerms", "Field", + choices = c("Keywords Plus" = "ID", + "Author's keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.growthTerms == 'AB' |input.growthTerms == 'TI'", + selectInput("growthTermsngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("WDStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.WDStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("WDStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("WDSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("WDStopPreview")) + ), + selectInput("WDSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.WDSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("WDSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("WDSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("WDSynPreview")) + )), + br(), + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("cumTerms", "Occurrences", + choices = c("Cumulate" = "Cum", + "Per year" = "noCum"), + selected = "Cum"), + sliderInput("topkw", label = "Number of words", + min = 1, max = 100, step = 1, value = c(1,10))), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1040,15 +2332,119 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Trend Topics"), align = "center")), - column(2, - actionButton("applyTrendTopics", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportTT", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Trend Topics"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyTrendTopics") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportTT") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "TTplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("trendTerms", "Field", + choices = c("Keywords Plus" = "ID", + "Author's keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.trendTerms == 'TI' | input.trendTerms == 'AB'", + selectInput("trendTermsngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + conditionalPanel( + condition = "input.trendTerms == 'TI' | input.trendTerms == 'AB'", + selectInput("trendStemming", label="Word Stemming", + choices = c("Yes" = TRUE, + "No" = FALSE), + selected = FALSE)), + uiOutput("trendSliderPY"), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("TTStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TTStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("TTStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TTSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TTStopPreview")) + ), + selectInput("TTSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TTSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("TTSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TTSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TTSynPreview")) + )), + br(), + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput("trendMinFreq", label = "Word Minimum Frequency", min = 0, max = 100, value = 5, step = 1), + ), + column(6, + numericInput("trendNItems", label = "Number of Words per Year", min = 1, max = 20, step = 1, value = 3) + ))), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1069,15 +2465,109 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Clustering by Coupling"), align = "center")), - column(2, - actionButton("applyCM", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportCC", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Clustering by Coupling"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCM") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCM") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "CMplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("CManalysis", + label = "Unit of Analysis", + choices = c("Documents" = "documents", + "Authors" = "authors", + "Sources" = "sources"), + selected = "documents"), + " ", + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, + collapsed = FALSE, + selectInput("CMfield", + label = "Coupling measured by", + choices = c("References" ="CR", + "Keywords Plus" = "ID", + "Author's Keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB"), + selected = "CR"), + conditionalPanel(condition = "input.CMfield == 'TI' | input.CMfield == 'AB'", + selectInput("CMstemming", label="Word Stemming", + choices = c("Yes" = TRUE, + "No" = FALSE), + selected = FALSE)), + selectInput("CMimpact", + label = "Impact measure", + choices = c("Local Citation Score" = "local", + "Global Citation Score" = "global"), + selected = "local"), + selectInput("CMlabeling", + label = "Cluster labeling by", + choices = c("None" = "none", + "Keyword Plus" = "ID", + "Authors' keywords" = "DE", + "Title terms" = "TI", + "Abstract terms" = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.CMlabeling == 'TI' | input.CMlabeling == 'AB'", + selectInput("CMngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + fluidRow(column(6, + numericInput("CMn", label="Number of Units\n ",value=250,min=50,max=5000,step=1)), + column(6, + numericInput("CMfreq", label="Min Cluster Freq. ",value=5,min=1,max=100,step=1))), + fluidRow(column(6, + numericInput("CMn.labels", label="Labels per cluster",value=3,min=1,max=10,step=1)), + column(6, + numericInput("sizeCM", label="Label size",value=0.3,min=0.0,max=1,step=0.05))), + fluidRow(column(6, + numericInput("CMrepulsion", label="Community Repulsion",value=0,min=0,max=1,step=0.01)), + column(6, + selectInput("CMcluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap") + )) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1098,20 +2588,276 @@ body <- dashboardBody( ) ), #### Conceptual Structure ---- - ##### co-occurence network ---- + ##### co-occurrence network ---- tabItem("coOccurenceNetwork", fluidPage( fluidRow( column(8, - h2(strong("Co-occurrence Network"), align = "center")), - column(2, - actionButton("applyCoc", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportCOC", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Co-occurrence Network"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCoc") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCOC") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenCOC") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("field", + "Field", + choices = c("Keywords Plus" = "ID", + "Author's Keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB", + "Subject Categories (WoS)" = "WC"), + selected = "ID"), + conditionalPanel(condition = "input.field == 'TI' | input.field == 'AB'", + selectInput("cocngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("COCStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.COCStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("COCStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("COCSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("COCStopPreview")) + ), + selectInput("COCSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.COCSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("COCSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("COCSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("COCSynPreview")) + )), + br(), + box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + selectInput("layout", + label = "Network Layout", + choices = c("Automatic layout"="auto", + "Circle"="circle", + "Fruchterman & Reingold"="fruchterman", + "Kamada & Kawai"="kamada", + "MultiDimensional Scaling"="mds", + "Sphere"="sphere", + "Star"="star"), + selected = "auto") + ), + column(6, + selectInput("cocCluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap") + )), + fluidRow(column(6, + selectInput("normalize", + label = "Normalization", + choices = c("none", + "association", + "jaccard", + "salton", + "inclusion", + "equivalence"), + selected = "association") + ), + column(6, + selectInput("cocyears", + label = "Node Color by Year", + choices = c("No" = "No", + "Yes"= "Yes"), + selected = "No") + ) + ), + fluidRow(column(6, + numericInput(inputId = "Nodes", + label = "Number of Nodes", + min = 5, + max = 1000, + value = 50, + step = 1) + ), + column(6, + numericInput(inputId = "coc.repulsion", + label = "Repulsion Force", + min = 0, + max = 1, + value = 0.1, + step = 0.1) + )), + fluidRow(column(6, + selectInput(inputId ="coc.isolates", + label = "Remove Isolated Nodes", + choices = c("Yes" = "yes", + "No" = "no"), + selected = "yes") + ), + column(6, + numericInput("edges.min", + label=("Minimum Number of Edges"), + value = 2, + step = 1, + min = 0) + ) + )), + br(), + box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput(inputId = "cocAlpha", + label = "Opacity", + min = 0, + max = 1, + value = 0.7, + step=0.05) + ), + column(6, + numericInput(inputId = "Labels", + label = "Number of labels", + min = 0, + max = 1000, + value = 1000, + step = 1) + )), + fluidRow(column(6, + selectInput(inputId ="label.cex", + label = "Label cex", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="coc.shape", + label = "Node Shape", + choices = c( + "Box"="box", + "Circle"="circle", + "Dot"="dot", + "Ellipse"="ellipse", + "Square"="square", + "Text"="text"), + selected = "dot") + )), + fluidRow(column(6, + numericInput(inputId = "labelsize", + label = "Label size", + min = 0.0, + max = 20, + value = 3, + step = 0.10) + ), + column(6, + numericInput( + inputId = "edgesize", + label = "Edge size", + min = 0.0, + max = 20, + value = 5, + step=0.5) + )), + fluidRow(column(6, + selectInput(inputId ="coc.shadow", + label = "Node shadow", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="coc.curved", + label = "Edit Nodes", + choices = c("Yes", + "No"), + selected = "No") + + ) + ) + ), + br(), + fluidRow(column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "network.coc", label = ("Pajek"), + style = "pill", color = "primary"))), + column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "networkCoc.fig", label = ("HTML"), + style = "pill", color = "primary"))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1132,14 +2878,143 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Thematic Map"), align = "center")), - column(2,actionButton("applyTM", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportTM", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Thematic Map"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyTM") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportTM") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "TMplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("TMfield", + label = "Field", + choices = c("Keywords Plus" = "ID", + "Author's Keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.TMfield == 'TI' | input.TMfield == 'AB'", + selectInput("TMngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + conditionalPanel( + condition = "input.TMfield == 'TI' | input.TMfield == 'AB'", + selectInput("TMstemming", label="Word Stemming", + choices = c("Yes" = TRUE, + "No" = FALSE), + selected = FALSE)), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("TMStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TMStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("TMStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TMSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TMStopPreview")) + ), + selectInput("TMapSynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TMapSynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("TMapSyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TMapSynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TMapSynPreview")) + )), + br(), + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput("TMn", label="Number of Words",value=250,min=50,max=5000,step=1) + ), + column(6, + numericInput("TMfreq", label="Min Cluster Frequency (per thousand docs)",value=5,min=1,max=100,step=1) + )), + fluidRow(column(6, + numericInput("TMn.labels", label="Number of Labels",value=3,min=0,max=10,step=1) + ), + column(6, + numericInput("sizeTM", label="Label size",value=0.3,min=0.0,max=1,step=0.05) + )), + fluidRow(column(6, + numericInput("TMrepulsion", label="Community Repulsion",value=0,min=0,max=1,step=0.01)), + column(6, + selectInput("TMCluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap") + ) + ) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1167,15 +3042,155 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Thematic Evolution"), align = "center")), - column(2,actionButton("applyTE", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play")) - ), - column(2, - actionButton("reportTE", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Thematic Evolution"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyTE") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportTE") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "TEplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("TEfield", + label = "Field", + choices = c("Keywords Plus" = "ID", + "Author's Keywords" = "DE", + "Titles" = "TI", + "Abstracts + " = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.TEfield == 'TI' | input.TEfield == 'AB'", + selectInput("TEngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("TEStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TEStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("TEStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TESep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TEStopPreview")) + ), + selectInput("TESynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.TESynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("TESyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("TESynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("TESynPreview")) + )), + br(), + box(title = p(strong("Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput("nTE", label="Number of Words",value=250,min=50,max=5000,step=1) + ), + column(6, + numericInput("fTE", label="Min Cluster Frequency (per thousand docs)",value=5,min=1,max=100,step=1) + )), + fluidRow(column(6, + selectInput("TEmeasure", + label = "Weight index", + choices = c("Inclusion Index" = "inclusion", + "Inclusion Index weighted by Word-Occurrences" = "weighted", + "Stability Index" = "stability" + ), + selected = "weighted") + ), + column(6, + numericInput("minFlowTE", label="Min Weight Index",value=0.1,min=0.02,max=1,step=0.02) + )), + fluidRow(column(6, + numericInput("sizeTE", label="Label size",value=0.3,min=0.0,max=1,step=0.05) + ), + column(6, + numericInput("TEn.labels", label="Number of Labels (for each cluster)",value=3,min=1,max=5,step=1) + )), + fluidRow(column(12, + selectInput("TECluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap")) + ) + ), + br(), + box(title = p(strong("Time Slices"),style='font-size:16px;color:black;'), + collapsible = FALSE, width = 15, + solidHeader = FALSE, collapsed = FALSE, + numericInput("numSlices", label="Number of Cutting Points",min=1,max=4,value=1), + "Please, write the cutting points (in year) for your collection", + uiOutput("sliders") + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1289,14 +3304,146 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Factorial Analysis"), align = "center")), - column(2,actionButton("applyCA", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportFA", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Factorial Analysis"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCA") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportFA") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "FAplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("method", + label = "Method", + choices = c("Correspondence Analysis" = "CA", + "Multiple Correspondence Analysis" = "MCA", + "Multidimensional Scaling"= "MDS"), + selected = "MCA"), + selectInput("CSfield", + label = "Field", + choices = c("Keywords Plus" = "ID", + "Author's Keywords" = "DE", + "Titles" = "TI", + "Abstracts" = "AB"), + selected = "ID"), + conditionalPanel(condition = "input.CSfield == 'TI' | input.CSfield == 'AB'", + selectInput("CSngrams",'N-Grams', + choices = c("Unigrams" = "1", + "Bigrams" = "2", + "Trigrams" = "3"), + selected = 1)), + br(), + box(title = p(strong("Text Editing"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + selectInput("CSStopFile", "Load a list of terms to remove", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.CSStopFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing a list of terms you want to remove from the analysis.")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator).")) + ), + fileInput("CSStop", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("CSSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("CSStopPreview")) + ), + selectInput("FASynFile", "Load a list of synonyms", + choices = c("Yes" = "Y", + "No" = "N"), + selected = "N"), + conditionalPanel(condition = "input.FASynFile == 'Y'", + helpText(h5(strong("Upload a TXT or CSV file containing, in each row, a list of synonyms, that will be merged into a single term (the first word contained in the row)")), + h5(("Terms have to be separated by a standard separator (comma, semicolon or tabulator). + Rows have to be separated by return separator.")) + ), + fileInput("FASyn", "", + multiple = FALSE, + accept = c("text/csv", + "text/comma-separated-values,text/plain", + ".csv", + ".txt")), + + selectInput("FASynSep", "File Separator", + choices = c('Comma ","' = ",", + 'Semicolon ";"' = ";", + 'Tab '= "\t"), + selected = ","), + h5(htmlOutput("FASynPreview")) + )), + br(), + box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput("CSn", + label=("Number of terms"), + value = 50, step = 1)), + column(6, + selectInput("nClustersCS", + label = "N. of Clusters", + choices = c("Auto" = "0", + "2" = "2", + "3" = "3", + "4" = "4", + "5" = "5", + "6" = "6", + "7" = "7", + "8" = "8"), + selected = "0"))) + ), + br(), + box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput( + inputId = "CSlabelsize", + label = "Label size", + min = 5, + max = 30, + value = 10)), + column(6, + numericInput("CSdoc", + label=("Num. of documents"), + value = 5))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1328,14 +3475,201 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Co-citation Network"), align = "center")), - column(2,actionButton("applyCocit", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportCOCIT", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Co-citation Network"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCocit") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCOCIT") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenCOCIT") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("citField", + label = "Field", + choices = c("Papers" = "CR", + "Authors" = "CR_AU", + "Sources" = "CR_SO"), + selected = "CR"), + selectInput(inputId = "citSep", + label = "Field separator character", + choices = c('";" (Semicolon)' = ";", + '". " (Dot and 3 or more spaces)' = ". ", + '"," (Comma)' = ","), + selected = "';'"), + br(), + box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + selectInput("citlayout", + label = "Network Layout", + choices = c("Automatic layout"="auto", + "Circle"="circle", + "Fruchterman & Reingold"="fruchterman", + "Kamada & Kawai"="kamada", + "MultiDimensional Scaling"="mds", + "Sphere"="sphere", + "Star"="star"), + selected = "auto") + ), + column(6, + selectInput("cocitCluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap") + )), + fluidRow(column(6, + numericInput(inputId = "citNodes", + label = "Number of Nodes", + min = 5, + max = 1000, + value = 50, + step = 1) + ), + column(6, + numericInput(inputId = "cocit.repulsion", + label = "Repulsion Force", + min = 0, + max = 1, + value = 0.1, + step = 0.1) + )), + fluidRow(column(6, + selectInput(inputId ="cit.isolates", + label = "Remove Isolated Nodes", + choices = c("Yes" = "yes", + "No" = "no"), + selected = "yes") + ), + column(6, + numericInput("citedges.min", + label=("Minimum Number of Edges"), + value = 2, + step = 1, + min = 0) + ) + )), + br(), + box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + selectInput(inputId ="citShortlabel", + label = "Short Label", + choices = c("Yes", + "No"), + selected = "Yes"), + + ), + column(6, + numericInput(inputId = "citLabels", + label = "Number of labels", + min = 0, + max = 1000, + value = 1000, + step = 1) + )), + fluidRow(column(6, + selectInput(inputId ="citlabel.cex", + label = "Label cex", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="cocit.shape", + label = "Node Shape", + choices = c( + "Box"="box", + "Circle"="circle", + "Dot"="dot", + "Ellipse"="ellipse", + "Square"="square", + "Text"="text"), + selected = "dot") + )), + fluidRow(column(6, + numericInput(inputId = "citlabelsize", + label = "Label size", + min = 0.0, + max = 20, + value = 2, + step = 0.10) + ), + column(6, + numericInput( + inputId = "citedgesize", + label = "Edge size", + min = 0.5, + max = 20, + value = 2, + step=0.5) + )), + fluidRow(column(6, + selectInput(inputId ="cocit.shadow", + label = "Node shadow", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="cocit.curved", + label = "Edit Nodes", + choices = c("Yes", + "No"), + selected = "No") + + ) + ) + ), + br(), + fluidRow(column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "network.cocit", label = ("Pajek"), + style = "pill", color = "primary"))), + column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "networkCocit.fig", label = ("HTML"), + style = "pill", color = "primary"))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1356,21 +3690,79 @@ body <- dashboardBody( fluidPage( fluidRow( column(8, - h2(strong("Historiograph"), align = "center")), - column(2,actionButton("applyHist", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportHIST", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + h3(strong("Historiograph"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyHist") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportHIST") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenHIST") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + numericInput(inputId = "histNodes", + label = "Number of Nodes", + min = 5, + max = 100, + value = 20, + step = 1), + " ", + br(), + box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, + collapsed = FALSE, + selectInput(inputId = "titlelabel", + label = "Node label", + choices = c("Short id (1st Author, Year)" = "short", + "Document Title" = "title", + "Authors' Keywords" = "keywords", + "Keywords Plus" = "keywordsplus"), + selected = "short"), + fluidRow(column(6, + numericInput(inputId = "histlabelsize", + label = "Label size", + min = 0.0, + max = 20, + value = 3, step = 1)), + column(6, + numericInput(inputId = "histsize", + label = "Node size", + min = 0, + max = 20, + value = 4, step = 1))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( tabsetPanel(type = "tabs", tabPanel("Network", shinycssloaders::withSpinner(visNetworkOutput("histPlotVis", height = "80vh"))), - # tabPanel("Plot", - # shinycssloaders::withSpinner(plotlyOutput(outputId = "histPlot", height = "75vh"))), tabPanel("Table", shinycssloaders::withSpinner(DT::DTOutput(outputId = "histTable"))) ) @@ -1382,13 +3774,205 @@ body <- dashboardBody( tabItem("collabNetwork", fluidPage( fluidRow( - column(8,h2(strong("Collaboration Network"), align = "center")), - column(2,actionButton("applyCol", strong("Run"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportCOL", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + column(8,h3(strong("Collaboration Network"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyCol") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCOL") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("actionBttn", c(export_bttn, list( + inputId = "screenCOL") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + selectInput("colField", + label = "Field", + choices = c("Authors" = "COL_AU", + "Institutions" = "COL_UN", + "Countries" = "COL_CO"), + selected = "COL_AU"), + br(), + box(title = p(strong("Method Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + selectInput("collayout", + label = "Network Layout", + choices = c("Automatic layout"="auto", + "Circle"="circle", + "Fruchterman & Reingold"="fruchterman", + "Kamada & Kawai"="kamada", + "MultiDimensional Scaling"="mds", + "Sphere"="sphere", + "Star"="star"), + selected = "auto") + ), + column(6, + selectInput("colCluster", + label = "Clustering Algorithm", + choices = c("None" = "none", + "Edge Betweenness" = "edge_betweenness", + "Fast Greedy" = "fast_greedy", + "InfoMap" = "infomap", + "Leading Eigenvalues" = "leading_eigen", + "Leiden" = "leiden", + "Louvain" = "louvain", + "Spinglass" = "spinglass", + "Walktrap" = "walktrap"), + selected = "walktrap") + )), + fluidRow(column(6, + selectInput("colnormalize", + label = "Normalization", + choices = c("none", + "association", + "jaccard", + "salton", + "inclusion", + "equivalence"), + selected = "association") + )), + fluidRow(column(6, + numericInput(inputId = "colNodes", + label = "Number of Nodes", + min = 5, + max = 1000, + value = 50, + step = 1) + ), + column(6, + numericInput(inputId = "col.repulsion", + label = "Repulsion Force", + min = 0, + max = 1, + value = 0.1, + step = 0.1) + )), + fluidRow(column(6, + selectInput(inputId ="col.isolates", + label = "Remove Isolated Nodes", + choices = c("Yes" = "yes", + "No" = "no"), + selected = "yes") + ), + column(6, + numericInput("coledges.min", + label=("Minimum Number of Edges"), + value = 1, + step = 1, + min = 0) + ) + )), + br(), + box(title = p(strong("Graphical Parameters"),style='font-size:16px;color:black;'), + collapsible = TRUE, width = 15, + solidHeader = FALSE, collapsed = TRUE, + fluidRow(column(6, + numericInput(inputId = "colAlpha", + label = "Opacity", + min = 0, + max = 1, + value = 0.7, + step=0.05) + ), + column(6, + numericInput(inputId = "colLabels", + label = "Number of labels", + min = 0, + max = 1000, + value = 1000, + step = 1) + )), + fluidRow(column(6, + selectInput(inputId ="collabel.cex", + label = "Label cex", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="col.shape", + label = "Node Shape", + choices = c( + "Box"="box", + "Circle"="circle", + "Dot"="dot", + "Ellipse"="ellipse", + "Square"="square", + "Text"="text"), + selected = "dot") + )), + fluidRow(column(6, + numericInput(inputId = "collabelsize", + label = "Label size", + min = 0.0, + max = 20, + value = 2, + step = 0.10) + ), + column(6, + numericInput( + inputId = "coledgesize", + label = "Edge size", + min = 0.5, + max = 20, + value = 5, + step=0.5) + )), + fluidRow(column(6, + selectInput(inputId ="col.shadow", + label = "Node shadow", + choices = c("Yes", + "No"), + selected = "Yes") + ), + column(6, + selectInput(inputId ="soc.curved", + label = "Edit Nodes", + choices = c("Yes", + "No"), + selected = "No") + + )) + ), + br(), + fluidRow(column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "network.col", label = ("Pajek"), + style = "pill", color = "primary"))), + column(6, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + width="100%", + downloadBttn(outputId = "networkCol.fig", label = ("HTML"), + style = "pill", color = "primary"))) + ), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1408,14 +3992,56 @@ body <- dashboardBody( tabItem("collabWorldMap", fluidPage( fluidRow( - column(8,h2(strong("Countries' Collaboration World Map"), align = "center")), - column(2,actionButton("applyWM", strong("Run"), - style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%",icon = fa_i(name ="play"))), - column(2, - actionButton("reportCOLW", strong("Report"),style ="border-radius: 10px; border-width: 3px; font-size: 15px; margin-top: 15px;", - width = "80%", - icon = icon(name ="plus", lib="glyphicon")) + column(8,h3(strong("Countries' Collaboration World Map"), align = "center")), + div(style=style_bttn, + title = t_run, + column(1, + do.call("actionBttn", c(run_bttn, list( + inputId = "applyWM") + )) + )), + div(style=style_bttn, + title = t_report, + column(1, + do.call("actionBttn", c(report_bttn, list( + inputId = "reportCOLW") + )) + )), + div(style=style_bttn, + title = t_export, + column(1, + do.call("downloadBttn", c(export_bttn, list( + outputId = "CCplot.save") + )) + )), + div(column(1, + dropdown( + h4(strong("Options: ")), + br(), + h4(strong("Method Parameters: ")), + " ", + numericInput("WMedges.min", + label=("Min edges"), + value = 2, + step = 1), + " ", + br(), + h4(strong("Graphical Parameters: ")), + " ", + numericInput(inputId = "WMedgesize", + label = "Edge size", + min = 0.1, + max = 20, + value = 5), + right = TRUE, animate = TRUE, circle = TRUE, + style = "gradient", + tooltip = tooltipOptions(title = "Options"), + color = "primary", + icon = icon("sliders"), + width = "300px" + ) + ), + style = style_opt ) ), fluidRow( @@ -1430,17 +4056,16 @@ body <- dashboardBody( ) ), #### Report ---- - ## NEW ---- tabItem("report", fluidPage( fluidRow( - h2(strong("Report"), align="center"), + h3(strong("Report"), align="center"), br(), ), fluidRow( - column(7,offset = 1, + column(6,offset = 1, box(title = strong("Select results to include in the Report", - style='font-size:25px;color:white;'), + style='font-size:20px;color:white;'), status = "primary", width = 11, solidHeader = TRUE, tags$style(HTML(" .box.box-solid.box-primary>.box-header { @@ -1454,76 +4079,114 @@ body <- dashboardBody( border-width:2px; }")), uiOutput('reportSheets'), - tags$style("#reportSheets {font-size:23px;}") + tags$style("#reportSheets {font-size:18px;}") ) - ), - column(3, + ),#column(1), + column(2, + div(style ="border-radius: 10px; border-width: 3px; font-size: 10px;", + align = "center", + #width="100%", actionBttn( inputId = 'allSheets', - label = strong('SELECT ALL'), + label = strong('Select All'), icon = icon("ok-circle", lib="glyphicon"), - style = "unite", #float - color = "default", + style = "pill", color = "primary", block = TRUE ), - tags$style("#allSheets {font-size:20px; color:#363636; background-color:white; text-align:center; border-width: 3px;}"), + #tags$style("#allSheets {font-size:20px; color:#363636; background-color:white; text-align:center; border-width: 3px;}"), br(), actionBttn( inputId = 'noSheets', - label = strong('DESELECT ALL'), + label = strong('Deselect All'), icon = icon("remove-circle", lib="glyphicon"), - style = "unite", - color = "default", - block = TRUE - ), - tags$style("#noSheets {font-size:20px; color:#363636; background-color:white; text-align:center; border-width: 3px;}"), - br(), - actionBttn( - inputId = 'deleteAll', - label = strong('DELETE REPORT'), - icon = icon("exclamation-sign", lib="glyphicon"), - style = "unite", - color = "danger", + style = "pill", color = "primary", block = TRUE ), - tags$style("#deleteAll {border-width: 3px;}"), + #tags$style("#noSheets {font-size:20px; color:#363636; background-color:white; text-align:center; border-width: 3px;}"), + + #tags$style("#deleteAll {border-width: 3px;}"), br(), + hr(), downloadBttn( outputId="report.save", - label = strong("SAVE REPORT"), - style = "unite", - color = "primary", + label = strong("Export Report"), + style = "pill", color = "success", size = "md", block = TRUE, no_outline = TRUE, icon = icon(name ="download-alt", lib="glyphicon") - ), tags$style("#report.save {border-width: 3px;}") - + ),#, tags$style("#report.save {border-width: 3px;}") + br(), + hr(), + actionBttn( + inputId = 'deleteAll', + label = strong('Delete Report'), + icon = icon("exclamation-sign", lib="glyphicon"), + style = "pill", color = "danger", + block = TRUE + ) + ) ) ) + ) + ), + #### Settings ---- + tabItem("settings", + fluidPage( + fluidRow( + h3(strong("Settings"), align="center"), + br() + ), + fluidRow(column(6, + h3("Plot settings:"), + br(), + sliderTextInput( + inputId = "dpi", + label = "Please select the desired DPI", + grid = TRUE, + force_edges = TRUE, + choices = c("75", "150", "300", "600"), + width = "70%", + selected = "300" + ), + br(), + sliderTextInput( + inputId = "h", + label = "Please select the desired heigth in inches", + grid = TRUE, + force_edges = TRUE, + width = "70%", + choices = seq(5,15), + selected = "7" + ) + ), column(6 + ### To insert settings for default path, etc. + ) + ) ) ) ) ) ## Control Bar #### -controlbar <- shinydashboardPlus::dashboardControlbar(id = "controlbar2", - uiOutput("controlbar"), - skin = "light", - width = 350, - overlay = FALSE, - collapsed = TRUE, - shinyjs::useShinyjs() -) +# controlbar <- shinydashboardPlus::dashboardControlbar(id = "controlbar2", +# uiOutput("controlbar"), +# skin = "light", +# width = 350, +# overlay = FALSE, +# collapsed = TRUE, +# shinyjs::useShinyjs() +# ) ## UI #### -ui <- shinydashboardPlus::dashboardPage(shinyjs::useShinyjs(), +ui <- shinydashboardPlus::dashboardPage( + #shinyjs::useShinyjs(), header = header, sidebar = sidebar, body = body, - controlbar = controlbar, + #controlbar = controlbar, footer = NULL, options = list(sidebarExpandOnHover = TRUE), scrollToTop =TRUE diff --git a/inst/biblioshiny/utils.R b/inst/biblioshiny/utils.R index 2fb39fe2..85f235c4 100644 --- a/inst/biblioshiny/utils.R +++ b/inst/biblioshiny/utils.R @@ -31,7 +31,7 @@ strSynPreview <- function(string){ } # from igraph to png file -igraph2PNG <- function(x, filename, width = 10, height = 7, dpi=300){ +igraph2PNG <- function(x, filename, width = 10, height = 7, dpi=75){ V(x)$centr <- centr_betw(x)$res df <- data.frame(name=V(x)$label,cluster=V(x)$color, centr=V(x)$centr) %>% group_by(.data$cluster) %>% @@ -1330,7 +1330,7 @@ hist2vis<-function(net, labelsize = 2, nodesize= 2, curved=FALSE, shape="dot", o vn$nodes <- vn$nodes %>% left_join(text_data, by = "id") ## split node tooltips into two strings - title <- strsplit(stringr::str_to_title(vn$nodes$title), " ") + title <- strsplit(stringi::stri_trans_totitle(vn$nodes$title), " ") vn$nodes$title <- unlist(lapply(title, function(l){ n <- floor(length(l)/2) @@ -1436,7 +1436,7 @@ addDataScreenWb <- function(list_df, wb, sheetname){ return(results) } -addGgplotsWb <- function(list_plot, wb, sheetname, col, width=10, height=7, dpi=300){ +addGgplotsWb <- function(list_plot, wb, sheetname, col, width=10, height=7, dpi=75){ l <- length(list_plot) startRow <- 1 for (i in 1:l){ @@ -1470,7 +1470,7 @@ screenSh <- function(selector){ return(file) } -addScreenWb <- function(df, wb, width=14, height=8, dpi=300){ +addScreenWb <- function(df, wb, width=14, height=8, dpi=75){ names(df) <- c("sheet","file","n") if (nrow(df)>0){ sheet <- unique(df$sheet) @@ -1491,7 +1491,7 @@ addScreenWb <- function(df, wb, width=14, height=8, dpi=300){ return(wb) } -addSheetToReport <- function(list_df, list_plot, sheetname, wb){ +addSheetToReport <- function(list_df, list_plot, sheetname, wb, dpi=75){ ind <- which(regexpr(sheetname,wb$sheet_names)>-1) if (length(ind)>0){ sheetname <- paste(sheetname,"(",length(ind)+1,")",sep="") @@ -1504,7 +1504,7 @@ addSheetToReport <- function(list_df, list_plot, sheetname, wb){ } else {col <- 1} if (!is.null(list_plot)){ - wb <- addGgplotsWb(list_plot, wb = wb, sheetname = sheetname, col = col) + wb <- addGgplotsWb(list_plot, wb = wb, sheetname = sheetname, col = col, dpi = dpi) } #values$sheet_name <- sheetname return(wb) @@ -1523,13 +1523,13 @@ dfLabel <- function(){ short <- c("Empty Report", "MainInfo", "AnnualSciProd", "AnnualCitPerYear", "ThreeFieldsPlot", "MostRelSources", "MostLocCitSources", "BradfordLaw", "SourceLocImpact", "SourceProdOverTime", "MostRelAuthors", "MostLocCitAuthors", "AuthorProdOverTime", "LotkaLaw", "AuthorLocImpact", "MostRelAffiliations", "AffOverTime", "CorrAuthCountries", "CountrySciProd", "CountryProdOverTime", "MostCitCountries", "MostGlobCitDocs", "MostLocCitDocs", "MostLocCitRefs", "RPYS", - "MostFreqWords", "WordCloud", "TreeMap", "WordFreqOverTime", "TrendTopics", "CoWordNet", "ThematicMap", "ThematicEvolution", + "MostFreqWords", "WordCloud", "TreeMap", "WordFreqOverTime", "TrendTopics", "CouplingMap", "CoWordNet", "ThematicMap", "ThematicEvolution", "TE_Period_1","TE_Period_2", "TE_Period_3","TE_Period_4","TE_Period_5", "FactorialAnalysis", "CoCitNet", "Historiograph", "CollabNet", "CollabWorldMap") long <- c("Empty Report", "Main Information", "Annual Scientific Production", "Annual Citation Per Year", "Three-Field Plot", "Most Relevant Sources","Most Local Cited Sources","Bradfords Law","Sources Local Impact", "Sources Production over Time", "Most Relevant Authors","Most Local Cited Authors","Authors Production over Time", "Lotkas Law","Authors Local Impact","Most Relevant Affiliations","Affiliations Production over Time", "Corresponding Authors Countries","Countries Scientific Production","Countries Production over Time","Most Cited Countries", "Most Global Cited Documents","Most Local Cited Documents","Most Local Cited References","Reference Spectroscopy", - "Most Frequent Words","WordCloud", "TreeMap", "Words Frequency over Time", "Trend Topics", "Co-occurence Network", "Thematic Map", "Thematic Evolution", + "Most Frequent Words","WordCloud", "TreeMap", "Words Frequency over Time", "Trend Topics", "Clustering by Coupling","Co-occurence Network", "Thematic Map", "Thematic Evolution", "TE_Period_1","TE_Period_2", "TE_Period_3","TE_Period_4","TE_Period_5","Factorial Analysis", "Co-citation Network", "Historiograph", "Collaboration Network", "Countries Collaboration World Map") data.frame(short=short,long=long) } diff --git a/man/figures/README-Co-Word Analysis-1.png b/man/figures/README-Co-Word Analysis-1.png index c6a048e2..30687321 100644 Binary files a/man/figures/README-Co-Word Analysis-1.png and b/man/figures/README-Co-Word Analysis-1.png differ diff --git a/man/figures/README-Co-Word Analysis-2.png b/man/figures/README-Co-Word Analysis-2.png index 1de676b3..391b62e1 100644 Binary files a/man/figures/README-Co-Word Analysis-2.png and b/man/figures/README-Co-Word Analysis-2.png differ diff --git a/man/figures/README-Co-citation network-1.png b/man/figures/README-Co-citation network-1.png index 770492ee..2958d993 100644 Binary files a/man/figures/README-Co-citation network-1.png and b/man/figures/README-Co-citation network-1.png differ diff --git a/man/figures/README-Historical Co-citation network-1.png b/man/figures/README-Historical Co-citation network-1.png index 398662e6..b13bbaa0 100644 Binary files a/man/figures/README-Historical Co-citation network-1.png and b/man/figures/README-Historical Co-citation network-1.png differ diff --git a/man/figures/README-Keyword c-occurrences-1.png b/man/figures/README-Keyword c-occurrences-1.png index c1c37dcc..dfcd8ffb 100644 Binary files a/man/figures/README-Keyword c-occurrences-1.png and b/man/figures/README-Keyword c-occurrences-1.png differ diff --git a/man/figures/README-plot generic function-3.png b/man/figures/README-plot generic function-3.png index 1d6ffe72..685230bf 100644 Binary files a/man/figures/README-plot generic function-3.png and b/man/figures/README-plot generic function-3.png differ diff --git a/man/figures/README-plot generic function-4.png b/man/figures/README-plot generic function-4.png index f0f4313a..3779c06c 100644 Binary files a/man/figures/README-plot generic function-4.png and b/man/figures/README-plot generic function-4.png differ diff --git a/man/figures/README-plot generic function-5.png b/man/figures/README-plot generic function-5.png index 51ef10ff..376b37c4 100644 Binary files a/man/figures/README-plot generic function-5.png and b/man/figures/README-plot generic function-5.png differ diff --git a/man/missingData.Rd b/man/missingData.Rd new file mode 100644 index 00000000..46bd88ef --- /dev/null +++ b/man/missingData.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/missingData.R +\name{missingData} +\alias{missingData} +\title{Completeness of bibliographic metadata} +\usage{ +missingData(M) +} +\arguments{ +\item{M}{is a bibliographic data frame obtained by \code{\link{convert2df}} function.} +} +\value{ +The function \code{missingData} returns a list containing two objects: +\tabular{lll}{ +\code{allTags} \tab \tab is a data frame including results for all original metadata tags from the collection\cr +\code{mandatoryTags}\tab \tab is a data frame that included only the tags needed for analysis with bibliometrix and biblioshiny.} +} +\description{ +It calculates the percentage of missing data in the metadata of a bibliographic data frame. +} +\details{ +Each metadata is assigned a status c("Excellent," "Good," "Acceptable", "Poor", "Critical," "Completely missing") +depending on the percentage of missing data. In particular, the column *status* classifies the percentage of missing +value in 5 categories: "Excellent" (0%), "Good" (0.01% to 10.00%), "Acceptable" (from 10.01% to 20.00%), +"Poor" (from 20.01% to 50.00%), "Critical" (from 50.01% to 99.99%), "Completely missing" (100%). + +The results of the function allow us to understand which analyses can be performed with bibliometrix +and which cannot based on the completeness (or status) of different metadata. +} +\examples{ +data(scientometrics, package = "bibliometrixData") +res <- missingData(scientometrics) +print(res$mandatoryTags) + +} diff --git a/man/thematicEvolution.Rd b/man/thematicEvolution.Rd index 7ef6d3c3..4049b5de 100644 --- a/man/thematicEvolution.Rd +++ b/man/thematicEvolution.Rd @@ -25,7 +25,7 @@ thematicEvolution( \item{field}{is a character object. It indicates the content field to use. Field can be one of c=("ID","DE","TI","AB"). Default value is \code{field="ID"}.} -\item{years}{is a numeric vector of two or more unique cut points.} +\item{years}{is a numeric vector of one or more unique cut points.} \item{n}{is numerical. It indicates the number of words to use in the network analysis}