Update app.R
Browse files
app.R
CHANGED
|
@@ -317,54 +317,57 @@ available_stats <- c("Pitches", "Avg Velo", "Top Velo", "TimStuff", "Max EV", "A
|
|
| 317 |
"Spin Rate", "Extension", "IVB", "HB", "CSW%", "Arm Angle", "Bat Speed")
|
| 318 |
|
| 319 |
# Then your UI and server code
|
| 320 |
-
ui <-
|
| 321 |
-
title = "MLB/AAA/FSL Statcast Data",
|
| 322 |
theme = bs_theme(preset = "united"),
|
| 323 |
-
|
| 324 |
-
col_width(4, xs = 12, sm = 12, md = 4, lg = 3, xl = 3),
|
| 325 |
-
col_width(8, xs = 12, sm = 12, md = 8, lg = 9, xl = 9)
|
| 326 |
-
),
|
| 327 |
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
)
|
| 358 |
),
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
tabulatorOutput("table", height = "800px")
|
| 368 |
)
|
| 369 |
)
|
| 370 |
|
|
|
|
| 317 |
"Spin Rate", "Extension", "IVB", "HB", "CSW%", "Arm Angle", "Bat Speed")
|
| 318 |
|
| 319 |
# Then your UI and server code
|
| 320 |
+
ui <- fluidPage(
|
|
|
|
| 321 |
theme = bs_theme(preset = "united"),
|
| 322 |
+
titlePanel("MLB/AAA/FSL Statcast Data"),
|
|
|
|
|
|
|
|
|
|
| 323 |
|
| 324 |
+
fluidRow(
|
| 325 |
+
# Left column (sidebar)
|
| 326 |
+
column(width = 3,
|
| 327 |
+
div(
|
| 328 |
+
style = "height: 100%; padding: 10px; background-color: #f8f9fa; border-right: 1px solid #dee2e6;",
|
| 329 |
+
p("X: ", a("(@TimStats)", href = "https://twitter.com/timstats")),
|
| 330 |
+
p("Data Updated To:", Sys.Date() - 1),
|
| 331 |
+
|
| 332 |
+
div(
|
| 333 |
+
class = "mb-3",
|
| 334 |
+
style = "background-color: white; padding: 15px; border-radius: 5px; margin-bottom: 15px;",
|
| 335 |
+
selectInput("level", "Level:",
|
| 336 |
+
c("MLB", "AAA", "FSL"),
|
| 337 |
+
multiple = TRUE
|
| 338 |
+
),
|
| 339 |
+
selectInput("group", "Group By:",
|
| 340 |
+
c("Pitcher Name", "Pitcher ID", "Pitch Name", "Batter Name",
|
| 341 |
+
"Batter ID", "Season", "Level", "Pitch Type", "Stadium",
|
| 342 |
+
"Batter Home/Away", "Pitcher Home/Away", "Pitcher Team",
|
| 343 |
+
"Batter Team"),
|
| 344 |
+
multiple = TRUE
|
| 345 |
+
),
|
| 346 |
+
selectInput("stats", "Select Stats:",
|
| 347 |
+
choices = available_stats,
|
| 348 |
+
multiple = TRUE
|
| 349 |
+
),
|
| 350 |
+
dateRangeInput("date_range", "Date Range:",
|
| 351 |
+
start = "2024-02-23",
|
| 352 |
+
end = Sys.Date() - 1,
|
| 353 |
+
min = "2024-02-23",
|
| 354 |
+
max = Sys.Date() - 1
|
| 355 |
+
)
|
| 356 |
+
),
|
| 357 |
+
actionButton("add_filter", "Add Filter", class = "btn-primary mb-3"),
|
| 358 |
+
uiOutput("filter_container"),
|
| 359 |
+
hr(),
|
| 360 |
+
actionButton("update_table", "Update Table", class = "btn-success")
|
| 361 |
)
|
| 362 |
),
|
| 363 |
+
|
| 364 |
+
# Right column (main content)
|
| 365 |
+
column(width = 9,
|
| 366 |
+
div(
|
| 367 |
+
style = "padding: 10px;",
|
| 368 |
+
tabulatorOutput("table", height = "800px")
|
| 369 |
+
)
|
| 370 |
+
)
|
|
|
|
| 371 |
)
|
| 372 |
)
|
| 373 |
|