TimStats commited on
Commit
00e1458
·
verified ·
1 Parent(s): 9e222c2

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +47 -44
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 <- page_fluid(
321
- title = "MLB/AAA/FSL Statcast Data",
322
  theme = bs_theme(preset = "united"),
323
- layout_columns(
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
- # Left column (sidebar)
329
- card(
330
- full_screen = FALSE,
331
- height = "100%",
332
- p("X: ", a("(@TimStats)", href = "https://twitter.com/timstats")),
333
- p("Data Updated To:", Sys.Date() - 1),
334
-
335
- card(
336
- class = "mb-3",
337
- selectInput("level", "Level:",
338
- c("MLB", "AAA", "FSL"),
339
- multiple = TRUE
340
- ),
341
- selectInput("group", "Group By:",
342
- c("Pitcher Name", "Pitcher ID", "Pitch Name", "Batter Name",
343
- "Batter ID", "Season", "Level", "Pitch Type", "Stadium",
344
- "Batter Home/Away", "Pitcher Home/Away", "Pitcher Team",
345
- "Batter Team"),
346
- multiple = TRUE
347
- ),
348
- selectInput("stats", "Select Stats:",
349
- choices = available_stats,
350
- multiple = TRUE
351
- ),
352
- dateRangeInput("date_range", "Date Range:",
353
- start = "2024-02-23",
354
- end = Sys.Date() - 1,
355
- min = "2024-02-23",
356
- max = Sys.Date() - 1
 
 
 
 
 
 
 
 
357
  )
358
  ),
359
- actionButton("add_filter", "Add Filter", class = "btn-primary mb-3"),
360
- uiOutput("filter_container"),
361
- hr(),
362
- actionButton("update_table", "Update Table", class = "btn-success")
363
- ),
364
-
365
- # Right column (main content)
366
- card(
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