Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -11,6 +11,10 @@ library(gridExtra)
|
|
| 11 |
library(gtable)
|
| 12 |
library(httr)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
is_barrel <- function(df) {
|
| 15 |
df$hit_speedr <- round(df$hit_speed)
|
| 16 |
df <- df |>
|
|
@@ -422,6 +426,10 @@ server <- function(input, output,session) {
|
|
| 422 |
|
| 423 |
output$statsPlot <- renderPlot({
|
| 424 |
req(position_value())
|
|
|
|
|
|
|
|
|
|
|
|
|
| 425 |
data <- data %>% filter(season == input$szn,level == input$level)
|
| 426 |
|
| 427 |
BBE <- MLBC %>%
|
|
@@ -496,7 +504,7 @@ server <- function(input, output,session) {
|
|
| 496 |
geom_text(aes(x = 103, label = value),
|
| 497 |
hjust = 0, size = 6, family = "roboto") +
|
| 498 |
geom_point(aes(x = percentile, color = "white", fill = color),
|
| 499 |
-
size = 6, shape = 21, stroke =
|
| 500 |
geom_text(aes(x = percentile, label = percentile),
|
| 501 |
size = 6, color = "white", fontface = "bold", family = "roboto") +
|
| 502 |
scale_x_continuous(limits = c(-16, 113), expand = c(0, 0)) +
|
|
|
|
| 11 |
library(gtable)
|
| 12 |
library(httr)
|
| 13 |
|
| 14 |
+
showtext_opts(dpi = 96) # Match plot DPI
|
| 15 |
+
showtext_auto(enable = TRUE)
|
| 16 |
+
font_add_google("Roboto Condensed", "roboto", regular.wt = 400, bold.wt = 700)
|
| 17 |
+
|
| 18 |
is_barrel <- function(df) {
|
| 19 |
df$hit_speedr <- round(df$hit_speed)
|
| 20 |
df <- df |>
|
|
|
|
| 426 |
|
| 427 |
output$statsPlot <- renderPlot({
|
| 428 |
req(position_value())
|
| 429 |
+
|
| 430 |
+
showtext::showtext_begin()
|
| 431 |
+
on.exit(showtext::showtext_end())
|
| 432 |
+
|
| 433 |
data <- data %>% filter(season == input$szn,level == input$level)
|
| 434 |
|
| 435 |
BBE <- MLBC %>%
|
|
|
|
| 504 |
geom_text(aes(x = 103, label = value),
|
| 505 |
hjust = 0, size = 6, family = "roboto") +
|
| 506 |
geom_point(aes(x = percentile, color = "white", fill = color),
|
| 507 |
+
size = 6, shape = 21, stroke = 1) +
|
| 508 |
geom_text(aes(x = percentile, label = percentile),
|
| 509 |
size = 6, color = "white", fontface = "bold", family = "roboto") +
|
| 510 |
scale_x_continuous(limits = c(-16, 113), expand = c(0, 0)) +
|