-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_ui.R
More file actions
129 lines (114 loc) · 4.15 KB
/
app_ui.R
File metadata and controls
129 lines (114 loc) · 4.15 KB
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
################################################################################
# UI
#
# This function contains the entire app's UI setup. It mainly consists of the
# dashboardPage and navbar. All module-specific UI content should be called
# using UI module functions.
################################################################################
app_UI <- function(request) {dashboardPage(
dashboardHeader(
title = paste0('ProTIGY v', packageVersion('Protigy')),
tags$li(class = "dropdown",
actionButton(
inputId = "clear_all_notifications_header",
label = "Clear All Notifications",
icon = icon("bell-slash"),
class = "btn-sm"
)
)
),
shinydashboard::dashboardSidebar(
setupSidebarUI()
),
dashboardBody(
# include custom CSS
includeCSS(system.file("custom.css", package = "Protigy")),
# include shinyjs
shinyjs::useShinyjs(),
# JavaScript to manage Clear All Notifications button visibility
tags$script(HTML("
$(document).ready(function() {
var MAX_NOTIFICATIONS = 10;
// Shiny appends new notifications; earliest in DOM are oldest - drop excess first.
function trimNotificationsToMax() {
var notifications = $('.shiny-notification');
var extra = notifications.length - MAX_NOTIFICATIONS;
if (extra > 0) {
notifications.slice(0, extra).remove();
}
}
// Function to update button visibility based on notification presence
function updateClearButton() {
trimNotificationsToMax();
var notifications = $('.shiny-notification');
if (notifications.length > 0) {
$('#clear_all_notifications_header').show();
} else {
$('#clear_all_notifications_header').hide();
}
}
// Use MutationObserver to watch for notification changes
var observer = new MutationObserver(function(mutations) {
updateClearButton();
});
// Observe the body for notification additions/removals
observer.observe(document.body, {
childList: true,
subtree: true
});
// Initial check
updateClearButton();
});
")),
navbarPage(
title = '',
id = "navbar-tabs",
navbarMenu(
"Help",
tabPanel("General", helpGeneralTabUI(), value = "Help-General"),
tabPanel("Customize", helpCustomizationTabUI(), value = "Help-Customize"),
tabPanel("Analysis", helpAnalysisTabUI(), value = "Help-Analysis"),
icon = icon("question")
),
tabPanel("Customize",
customizeTabUI(),
icon = icon("wand-magic-sparkles")),
tabPanel("Summary", summaryTabUI(), value = "Summary"),
navbarMenu(
"QC",
tabPanel("Boxplots",QCBoxplots_Tab_UI(), value="QC-Boxplots"),
tabPanel("Profile plots", QCProfilePlots_Tab_UI(),value="QC-Profile-Plots"),
tabPanel("Correlation", QCCorrelation_Tab_UI(), value="QC-Correlation"),
tabPanel("PCA", QCPCA_Tab_UI(), value="QC-PCA")),
navbarMenu(
"Statistics",
tabPanel("Setup", statSetup_Tab_UI(), value = "Statistics-Setup"),
tabPanel("Summary", statSummary_Tab_UI(), value = "Statistics-Summary"),
tabPanel("Volcano Plot", statPlot_Tab_UI(), value = "Statistics-Volcano")
# tabPanel("Table", statTable_Tab_UI())
),
# navbarMenu(
# "Clustering",
# tabPanel("Static Heatmap"),
# tabPanel("Fan Plot")),
# navbarMenu(
# "Volcanos",
# tabPanel("1"),
# tabPanel("2")),
# navbarMenu(
# "Scatterplots",
# tabPanel("1"),
# tabPanel("2")),
# tabPanel("Table"),
navbarMenu(
"Multi-ome",
tabPanel('Heatmap', multiomeHeatmapTabUI())
#tabPanel('Pair-wise correlation'),
#tabPanel('More ideas?')
),
tabPanel("Export", exportTabUI(), icon = icon("download")),
#tabPanel("TEMPLATE", templateSingleOme_Tab_UI())
) #end navbarPage
) # end dashboardBody
) # end dashboardPage
}