Spaces:
Sleeping
Sleeping
Update app.R
Browse files
app.R
CHANGED
|
@@ -352,16 +352,18 @@ ui <- fluidPage(
|
|
| 352 |
actionButton("update", "Find Pitcher", icon("magnifying-glass"),
|
| 353 |
class = "btn-primary btn-block"),
|
| 354 |
selectizeInput("pitcher", "Pitcher Name:", NULL),
|
| 355 |
-
|
| 356 |
actionButton("update1", "Make Card", icon("plus"),
|
| 357 |
class = "btn-success btn-block"),
|
| 358 |
downloadButton("downloadPlot", "Download Card", class = "btn-info btn-block")
|
| 359 |
),
|
| 360 |
mainPanel(
|
| 361 |
-
|
|
|
|
| 362 |
)
|
| 363 |
)
|
| 364 |
)
|
|
|
|
| 365 |
|
| 366 |
server <- function(input, output, session) {
|
| 367 |
observeEvent(input$level, {
|
|
@@ -573,20 +575,17 @@ server <- function(input, output, session) {
|
|
| 573 |
|
| 574 |
output$combinedPlot <- renderPlot({
|
| 575 |
grid.draw(combinedPlot())
|
| 576 |
-
})
|
| 577 |
-
|
| 578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 579 |
})
|
| 580 |
})
|
| 581 |
-
|
| 582 |
-
output$downloadPlot <- downloadHandler(
|
| 583 |
-
filename = function() {
|
| 584 |
-
paste("baseball_card_", Sys.Date(), ".png", sep = "")
|
| 585 |
-
},
|
| 586 |
-
content = function(file) {
|
| 587 |
-
ggsave(file, plot = combinedPlot(), width = 18, height = 12, dpi = 300)
|
| 588 |
-
}
|
| 589 |
-
)
|
| 590 |
}
|
| 591 |
-
|
| 592 |
shinyApp(ui, server)
|
|
|
|
| 352 |
actionButton("update", "Find Pitcher", icon("magnifying-glass"),
|
| 353 |
class = "btn-primary btn-block"),
|
| 354 |
selectizeInput("pitcher", "Pitcher Name:", NULL),
|
| 355 |
+
textInput("title", "Card Title"),
|
| 356 |
actionButton("update1", "Make Card", icon("plus"),
|
| 357 |
class = "btn-success btn-block"),
|
| 358 |
downloadButton("downloadPlot", "Download Card", class = "btn-info btn-block")
|
| 359 |
),
|
| 360 |
mainPanel(
|
| 361 |
+
div(style = "width: 1200px; height: 800px; overflow: auto;", # Fixed size container
|
| 362 |
+
plotOutput("combinedPlot", width = "100%", height = "100%")
|
| 363 |
)
|
| 364 |
)
|
| 365 |
)
|
| 366 |
+
)
|
| 367 |
|
| 368 |
server <- function(input, output, session) {
|
| 369 |
observeEvent(input$level, {
|
|
|
|
| 575 |
|
| 576 |
output$combinedPlot <- renderPlot({
|
| 577 |
grid.draw(combinedPlot())
|
| 578 |
+
}, width = 1200, height = 800) # Fixed size output
|
| 579 |
+
|
| 580 |
+
output$downloadPlot <- downloadHandler(
|
| 581 |
+
filename = function() {
|
| 582 |
+
paste("baseball_card_", Sys.Date(), ".png", sep = "")
|
| 583 |
+
},
|
| 584 |
+
content = function(file) {
|
| 585 |
+
ggsave(file, plot = combinedPlot(), width = 18, height = 12, dpi = 300, units = "in")
|
| 586 |
+
}
|
| 587 |
+
)
|
| 588 |
})
|
| 589 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
}
|
|
|
|
| 591 |
shinyApp(ui, server)
|