Spaces:
Runtime error
Runtime error
Update app.R
Browse files
app.R
CHANGED
|
@@ -11,7 +11,7 @@ library(gridExtra)
|
|
| 11 |
library(gtable)
|
| 12 |
library(httr)
|
| 13 |
|
| 14 |
-
|
| 15 |
showtext_auto(enable = TRUE)
|
| 16 |
font_add_google("Roboto Condensed", "roboto")
|
| 17 |
|
|
@@ -427,15 +427,7 @@ server <- function(input, output,session) {
|
|
| 427 |
|
| 428 |
output$statsPlot <- renderPlot({
|
| 429 |
req(position_value())
|
| 430 |
-
|
| 431 |
-
user_agent <- session$request$HTTP_USER_AGENT
|
| 432 |
-
|
| 433 |
-
# Set DPI based on device
|
| 434 |
-
if(grepl("Mobile|Android|iPhone", user_agent)) {
|
| 435 |
-
showtext_opts(dpi = 200) # Mobile devices
|
| 436 |
-
} else {
|
| 437 |
-
showtext_opts(dpi = 96) # Desktop/laptop
|
| 438 |
-
}
|
| 439 |
showtext::showtext_begin()
|
| 440 |
on.exit(showtext::showtext_end())
|
| 441 |
|
|
@@ -482,10 +474,10 @@ server <- function(input, output,session) {
|
|
| 482 |
annotate("text", x = c(10, 50, 90), y = 1,
|
| 483 |
label = c("Poor", "Average", "Great"),
|
| 484 |
color = c("#3661ad", "#90A4AE", "#DC3545"),
|
| 485 |
-
family = "roboto", size =
|
| 486 |
annotate("text", x = c(10, 50, 90), y = 0.4,
|
| 487 |
label = "▲",
|
| 488 |
-
color = c("#3661ad", "#90A4AE", "#DC3545"), size =
|
| 489 |
scale_x_continuous(limits = c(-16, 113), expand = c(0, 0)) +
|
| 490 |
scale_y_continuous(limits = c(0.5, 1.5)) +
|
| 491 |
theme_void()
|
|
|
|
| 11 |
library(gtable)
|
| 12 |
library(httr)
|
| 13 |
|
| 14 |
+
showtext_opts(dpi = 300) # Match plot DPI
|
| 15 |
showtext_auto(enable = TRUE)
|
| 16 |
font_add_google("Roboto Condensed", "roboto")
|
| 17 |
|
|
|
|
| 427 |
|
| 428 |
output$statsPlot <- renderPlot({
|
| 429 |
req(position_value())
|
| 430 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
showtext::showtext_begin()
|
| 432 |
on.exit(showtext::showtext_end())
|
| 433 |
|
|
|
|
| 474 |
annotate("text", x = c(10, 50, 90), y = 1,
|
| 475 |
label = c("Poor", "Average", "Great"),
|
| 476 |
color = c("#3661ad", "#90A4AE", "#DC3545"),
|
| 477 |
+
family = "roboto", size = 4) +
|
| 478 |
annotate("text", x = c(10, 50, 90), y = 0.4,
|
| 479 |
label = "▲",
|
| 480 |
+
color = c("#3661ad", "#90A4AE", "#DC3545"), size = 8) +
|
| 481 |
scale_x_continuous(limits = c(-16, 113), expand = c(0, 0)) +
|
| 482 |
scale_y_continuous(limits = c(0.5, 1.5)) +
|
| 483 |
theme_void()
|