-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_interface.R
executable file
·244 lines (240 loc) · 16.6 KB
/
user_interface.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
wosMenu<-sidebarMenu(
menuItem('Bibliography',
tabName = 'tabItemBibs',
icon = icon('database')),
menuItem('Data',
tabName = 'bibDT',
icon = icon('book'),
startExpanded = TRUE,
menuSubItem('Import', tabName = 'tabItemLibraryImport'),
menuSubItem('Journals', tabName = 'tabItemJournals'),
menuSubItem('Authors', tabName = 'tabItemResearchers')
),
menuItem('Analysis',
tabName = 'analysis',
icon = icon('bar-chart-o'),
startExpanded = T,
menuSubItem('Keywords', tabName = 'tabItemKeywordsAnalysis'),
menuSubItem('Topics', tabName = 'tabItemTopicAnalysis')
),
menuItem('About',
tabName = 'tabItemAbout',
icon = icon('question-circle')) )
bibFilterPanel<-conditionalPanel(condition="input.hideFilter == false",
fluidRow(column(2,
checkboxInput("checkKeyWords", "With key words"),
checkboxInput("checkAbstract", "With abstracts"),
checkboxInput("checkFullText", "Full text"),
textInput("Authors", "Enter author`s names", value = "")),
column(3,
sliderInput("sliderYear",
"Year`s range",
min = d$filters$year$min, max = d$filters$year$max,
step = 1, round = 0,
value = c(d$filters$year$max-5,d$filters$year$max)),
sliderInput("sliderJscore",
"Journal score",
min =d$filters$jscore$min, max = d$filters$jscore$max,
step = .1, round = 2,
value = c(1,d$filters$jscore$max))
),
column(3,
sliderInput("sliderAscore",
"Author`s score",
min =d$filters$ascore$min, max = d$filters$ascore$max,
step = .1, round = 2,
value = c(0,d$filters$ascore$max)),
sliderInput("sliderNrecords",
"Author`s number of records",
min =d$filters$nrecord$min, max = d$filters$nrecord$min,
step = 1, round = 0,
value = c(1,d$filters$nrecord$min))
),
column(4,
selectInput("Journal",
"Journals",
choices = c("All", g$specs$journals %>% pull(mydbtitle)),
selected = "All"),
selectInput("Publisher",
"Publishers",
choices = d$select$publishers,
selected = "All"))),
shiny::tags$div(class="header", checked=NA,
shiny::tags$p("Search in...")),
fluidRow(column(3,
textAreaInput("searchKeyWords", "key words", "")),
column(3,
textAreaInput("searchTitle", "title", "")),
column(3,
textAreaInput("searchAbstract", "abstract", "")),
column(3,
textAreaInput("searchFullText", "full text", ""))),
fluidRow(column(3,
downloadButton("openPDFMain", "Open selected .pdf from table below")),
column(3,
actionButton("deleteSelectedFromMainDB", "Delete selected records")),
column(3,
actionButton("resetSelectionInMainDB", "Reset selection"))))
checkBibReferencesPanel<-conditionalPanel(condition="input.hideCheckReferencesPanel == false",
fluidRow(column(2,checkboxInput("checkShowDuplicates", "Show Duplicates")),
column(2, actionButton("deleteDuplicates", "Delete duplicates")),
column(2, actionButton("checkReferences", "Check References")) ))
bibExportPanel<-fluidRow(column(4,
actionButton("addSelected", "Add selected records to export table"),
br(),br(),
actionButton("removeSelected", "Remove selected record from export table"),
br(),br(),
downloadButton("openPDF", "Open selected .pdf from table below")),
column(4,
actionButton("addExportFolder", "Add export folder"),
actionButton("deleteExportFolder", "Delete export folder"),
textInput("newExportFolder", "New export folder"),
actionButton("loadBibs", "Load records"),
actionButton("exportBibs", "Export records")),
column(4,
selectInput("exportFolders", "Research paper folder:",
choices = d$paths$papers,
selected = d$select$exportFolder),
selectInput("exportFileFormats", "File formats",
choices = g$select$fileFormats,
selected = d$select$fileFormat)))
tabBibs<-tabItem(tabName="tabItemBibs",
bibFilterPanel,
checkBibReferencesPanel,
fluidRow(column(3,checkboxInput("hideFilter", "Hide/Show Filter Panel")),
column(3,checkboxInput("hideCheckReferencesPanel", "Hide/Show Check References Panel", value = T)),
column(3,actionButton("applyFilter", "Apply Filter")),
column(3,actionButton("resetFilter", "Reset Filter"))),
fluidRow(box(DT::dataTableOutput('tableBibs'),
'Bibliography records from research journals, select to export...',
width = 12, solidHeader = T),
width=12),
fluidRow(tabBox(title = "Selected bibliography record",
id="tabSelectedBibRecord",
width = 12,
tabPanel("APA style",
htmlOutput("cur_bib")),
tabPanel("Bibtex format",
htmlOutput("cur_bibtex")))),
bibExportPanel,
fluidRow(tabBox(title = "Selected bibliography records",
width=12,
tabPanel("Table",
DT::dataTableOutput('tableBibsExport'),
'Bibliography records from research journals, select to export...'),
tabPanel("Record summary",
DT::dataTableOutput('tableBibsExportSummary'),
'Summary statistics for selected bibliography records'),
tabPanel("Bibtex",
htmlOutput("cur_bibtex_multy")),
tabPanel("RMarkdown",
htmlOutput("cur_bibtex_rmarkdown")),
tabPanel("RMarkdown with text chunks",
fluidRow(
column(3,actionButton("suggestTerms", "Suggest Terms"),br(),br(),
actionButton("get_text_chunks", HTML("Get RMarkdown<br/>with text chunks"),
style="white-space: normal;
text-align:center;
height:50px;
width:150px;
font-size: 14px;")),
column(6,textAreaInput("termsToFindInFullTexts","Search Terms in Full Texts",
width = 600, rows = 4))),
htmlOutput("text_chunks_with_terms")) )),
fluidRow(tabBox(title = "Selected bibliography record",
id="tabSelectedBibRecordForExport",
width = 12,
tabPanel("APA style",
htmlOutput("cur_bibExport")),
tabPanel("Bibtex format",
htmlOutput("cur_bibtexExport"))))
)
tabResearchers<-tabItem(tabName="tabItemResearchers",
fluidRow(box('Top researchers Clarivate Analytics',
DT::dataTableOutput('tableResearchers'),
width = 12, solidHeader = T),
width=12),
fluidRow(box('Top researchers by year',
DT::dataTableOutput('tableTopResearchersByYear'),
width = 12, solidHeader = T),
width=12),
fluidRow(box('Verbose researchers by year',
DT::dataTableOutput('tableVerboseResearchersByYear'),
width = 12, solidHeader = T),
width=12))
tabJournals<-tabItem(tabName="tabItemJournals",
fluidRow(box('Scopus journals cite score metrics',
DT::dataTableOutput('tableJournals'),
width = 12, solidHeader = T),
width=12) )
tabLibraryImport<-tabItem(tabName="tabItemLibraryImport",
fluidRow(box(actionButton("importResearchPapers", "Import research papers"),
actionButton("getBibEntryWithDOI", "Get bib entries for downloaded .pdf files"),
checkboxInput("deleteSourcePDFs", "Delete source .pdf files", value=F),
width = 12)),
fluidRow(box("Publishers statistics",
DT::dataTableOutput('tablePublisherStat'),
width = 12, solidHeader = T),
width=12),
fluidRow(column(4,
selectInput("separateJournal",
"Select journal to show statistics for...",
choices = g$specs$journals %>% pull(mydbtitle)))),
fluidRow(box("Separate journal statistics (#abstracts/#full text records/#bib records)",
DT::dataTableOutput('tableSeparateJournalStat'),
width = 12, solidHeader = T)),
fluidRow(tabBox(title = "Whole library",
id="tabWholeLibrary",
width = 12,
tabPanel("Journal update plan",
DT::dataTableOutput('tableJournalUpdatePlan')),
tabPanel("Updates history",
DT::dataTableOutput('tableJournalUpdatesHistory'), width=6),
tabPanel("Whole library statistics (Full text/Abstract/Total)",
DT::dataTableOutput('tableWholeLibraryStat'))
)))
tabKeywordsAnalysis<-tabItem(tabName = "tabItemKeywordsAnalysis",
fluidRow(box(actionButton("computeKeyWordsFrequencies", "Compute key word frequencies"),
width = 12)),
fluidRow(
tabBox(title = "Word frequencies",
id="tabWordFrequencies",
width = 12,
tabPanel("Key word modified scores by year",
"Key word modified scores by year",
DT::dataTableOutput('tableKeyWordMscore'),
"Key word modified scores for all selected records",
plotOutput("plotKeyWordMscore")),
tabPanel("Key words frequencies",
DT::dataTableOutput('tableKeyWordFrequencies'),
"Key word frequencies for all selected records",
plotOutput("plotKeyWordFrequencies"))
)))
tabTopicAnalysis<-tabItem(tabName = "tabItemTopicAnalysis",
fluidRow(box(actionButton("startTopicAnalysis", "Start topic analysis"),
textInput("frontierYear", "Start from year", d$filters$year$frontierYear, width = "50%"),
actionButton("showTopicAnalysisResults", "Show Topic Analysis Results"),
width = 6)),
fluidRow(box("Topic analysis results",
DT::dataTableOutput('tableTopicModelSummary'),
width = 12, solidHeader = T)),
fluidRow(box(plotOutput("plotTopicModelDendrogram"),
width = 12)),
fluidRow(box("Topic models coherence matrix",
plotOutput("plotTopicModelCoherence"),
width = 12)) )
tabAbout<-tabItem(tabName = "tabItemAbout",
fluidRow(title = "About Web of science reference manager",
column(4),
column(4,
shiny::span(shiny::tagList(shiny::tags$img(src='wos-logo.png',
height='45',
width='125'))))),
fluidRow(column(2),
column(8, box(width=12, paste("Bibliography manager. <br/>
This shiny application allows to import, organize, manage and export bibiliography references in .bibtex format (JabRef) and in RMarkdown reference format together with corresponding fulltexts in .pdf format.
<br/> © Borochkin A.A.,", year(Sys.Date())) %>% HTML)),
column(2)),
fluidRow(column(2, actionButton("checkForUpdates", "Check for updates")),
column(5, textInput("sourcePath", "Source path:", value=g$path$source)),
column(5, textInput("destinationPath", "Destination path:", value =g$path$destination))))