Repository navigation
Expand file tree
/
Copy pathui.R
More file actions
157 lines (144 loc) · 5.98 KB
/
Copy pathui.R
File metadata and controls
157 lines (144 loc) · 5.98 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
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
ui <- fluidPage(
titlePanel("Interactive Plot"),
sidebarLayout(
sidebarPanel(
# Data source selection
selectInput("data_source", "Choose Data Source",
choices = c("Upload File" = "file",
"Built-in Dataset" = "builtin")),
# File upload
conditionalPanel(
condition = "input.data_source == 'file'",
fileInput("file", "Choose CSV File",
multiple = FALSE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv"))
),
# Built-in dataset selection
conditionalPanel(
condition = "input.data_source == 'builtin'",
selectInput("builtin_dataset", "Select Dataset",
choices = c("mtcars", "iris", "diamonds", "midwest"))
),
# Plot type selection
selectInput("plot_type", "Select Plot Type",
choices = c("Scatter Plot" = "scatter",
"Bar Plot" = "bar",
"Box Plot" = "box")),
# Dynamic UI elements for variable selection
uiOutput("variable_selectors"),
# Plot customization sections
tabsetPanel(
id = "customization_tabs",
tabPanel("General",
# Basic plot customization
conditionalPanel(
condition = "input.plot_type == 'scatter'",
numericInput("point_size", "Point Size", value = 3, min = 1, max = 10),
selectInput("point_shape", "Point Shape",
choices = c("Circle" = 16, "Triangle" = 17, "Square" = 15))
),
# Color selection
selectInput("color_var", "Color By", choices = NULL)
),
tabPanel("Labels",
# Plot title customization
textInput("plot_title", "Plot Title", ""),
selectInput("title_font", "Title Font",
choices = c("sans", "serif", "mono")),
numericInput("title_size", "Title Size", value = 16, min = 8, max = 32),
checkboxInput("title_bold", "Bold Title", value = FALSE),
selectInput("title_color", "Title Color",
choices = c("Black" = "black",
"Dark Gray" = "darkgray",
"Blue" = "blue",
"Dark Blue" = "darkblue",
"Red" = "red",
"Dark Red" = "darkred",
"Green" = "green",
"Dark Green" = "darkgreen")),
# Axis labels
textInput("x_label", "X-axis Label", ""),
textInput("y_label", "Y-axis Label", ""),
selectInput("axis_font", "Axis Labels Font",
choices = c("sans", "serif", "mono")),
numericInput("axis_label_size", "Axis Labels Size",
value = 12, min = 8, max = 24),
selectInput("x_label_color", "X-axis Label Color",
choices = c("Black" = "black",
"Dark Gray" = "darkgray",
"Blue" = "blue",
"Dark Blue" = "darkblue",
"Red" = "red",
"Dark Red" = "darkred",
"Green" = "green",
"Dark Green" = "darkgreen")),
selectInput("y_label_color", "Y-axis Label Color",
choices = c("Black" = "black",
"Dark Gray" = "darkgray",
"Blue" = "blue",
"Dark Blue" = "darkblue",
"Red" = "red",
"Dark Red" = "darkred",
"Green" = "green",
"Dark Green" = "darkgreen"))
),
tabPanel("Theme",
selectInput("theme_choice", "Plot Theme",
choices = c("Classic" = "theme_classic",
"Minimal" = "theme_minimal",
"Black & White" = "theme_bw",
"Light" = "theme_light")),
selectInput("axis_text_font", "Axis Text Font",
choices = c("sans", "serif", "mono")),
numericInput("axis_text_size", "Axis Text Size",
value = 10, min = 6, max = 20),
checkboxInput("grid_lines", "Show Grid Lines", value = TRUE)
)
)
),
mainPanel(
# Download button and format selection
fluidRow(
column(4,
selectInput("download_format", "Export Format",
choices = c("PNG" = "png",
"JPEG" = "jpeg",
"PDF" = "pdf",
"SVG" = "svg"))
),
column(4,
selectInput("download_units", "Dimension Units",
choices = c("Inches" = "in",
"Centimeters" = "cm",
"Pixels" = "px"))
),
column(4,
selectInput("download_dpi", "Resolution (DPI)",
choices = c("72 (Screen)" = "72",
"150 (Medium)" = "150",
"300 (High)" = "300",
"600 (Print)" = "600"))
)
),
fluidRow(
column(4,
numericInput("download_width", "Width",
value = 7, min = 1, max = 100)
),
column(4,
numericInput("download_height", "Height",
value = 5, min = 1, max = 100)
),
column(4,
downloadButton("download_plot", "Download Plot")
)
),
# Plot output
plotOutput("plot"),
# Error/warning messages
verbatimTextOutput("messages")
)
)
)