-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
79 lines (70 loc) · 2.03 KB
/
ui.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
ui <- fluidPage(
# Add a theme for a more polished appearance
theme = bslib::bs_theme(version = 5, bootswatch = "flatly"),
# Custom CSS
tags$head(
tags$style(HTML("
.custom-select {
border-radius: 5px;
padding: 6px;
}
.app-header {
background-color: #f8f9fa;
padding: 20px;
margin-bottom: 20px;
text-align: center;
}
"))
),
# Centered, styled title panel
div(
class = "app-header",
h1("Data Visualization App", style = "color: #333; font-weight: bold;")
),
# Sidebar Layout
sidebarLayout(
# Sidebar Panel with improved styling
sidebarPanel(
style = "background-color: #f4f4f4; border-radius: 10px; padding: 15px;",
# File Upload with additional styling
div(
style = "margin-bottom: 15px;",
fileInput("upload1",
"Upload Data File",
accept = c(".csv", ".tsv", ".xlsx"),
width = "100%",
buttonLabel = "Browse...",
placeholder = "No file selected")
),
# X Variable Dropdown
selectInput('xvar',
'Select X Variable',
choices = NULL,
width = "100%"),
# Y Variable Dropdown
selectInput('yvar',
'Select Y Variable',
choices = NULL,
width = "100%"),
selectInput('graphtype',
'Select the Graph Type',
choices = c('scatter', 'box', 'bar'),
width = "100%"),
# Title Input
textInput('title',
'Graph Title',
placeholder = "Enter graph title",
width = "100%")
),
# Main Panel with Tabset
mainPanel(
tabsetPanel(
id = "tabs",
tabPanel("Graph",
plotlyOutput('the_graph', height = "600px")),
tabPanel("Data",
dataTableOutput('the_data'))
)
)
)
)