Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -401,22 +401,23 @@ server <- function(input, output, session){
|
|
| 401 |
if (nrow(hit)==1) show_pitch_modal(hit)
|
| 402 |
})
|
| 403 |
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
|
|
|
| 420 |
|
| 421 |
observeEvent(input$update_pitch, {
|
| 422 |
info <- selected_pitch()
|
|
|
|
| 401 |
if (nrow(hit)==1) show_pitch_modal(hit)
|
| 402 |
})
|
| 403 |
|
| 404 |
+
output$selected_pitch_info <- renderText({
|
| 405 |
+
info <- selected_pitch()
|
| 406 |
+
if (is.null(info)) return("No pitch selected")
|
| 407 |
+
d <- info$data
|
| 408 |
+
|
| 409 |
+
paste(
|
| 410 |
+
paste("Pitcher:", info$pitcher),
|
| 411 |
+
if ("PitchNo" %in% names(d) && !is.na(d$PitchNo)) paste("PitchNo:", d$PitchNo) else "",
|
| 412 |
+
paste("Current Type:", d$TaggedPitchType),
|
| 413 |
+
paste("Velocity:", round(d$RelSpeed, 1), "mph"),
|
| 414 |
+
paste("Horizontal Break:", round(d$HorzBreak, 1), "inches"),
|
| 415 |
+
paste("Induced Vertical Break:", round(d$InducedVertBreak, 1), "inches"),
|
| 416 |
+
if ("SpinRate" %in% names(d) && !is.na(d$SpinRate)) paste("Spin Rate:", round(d$SpinRate, 0), "rpm") else "",
|
| 417 |
+
if ("Date" %in% names(d) && !is.na(d$Date)) paste("Date:", format(as.Date(d$Date))) else "",
|
| 418 |
+
sep = "\n"
|
| 419 |
+
)
|
| 420 |
+
})
|
| 421 |
|
| 422 |
observeEvent(input$update_pitch, {
|
| 423 |
info <- selected_pitch()
|