Hi,
I'm having trouble saving a {{gt}} table with {{shinyscreenshot}}. Numeric columns have a cropped resolution.
Is this a gt or shinyscreenshot problem and how can I fix this?
Are there other solutions to saving gt output from shiny, possibly by working with downloadHandler and gt_save? (r - How to save plots that are made in a shiny app - Stack Overflow)
Thanks!
library(shiny)
library(gt)
library(magrittr)
library(shinyscreenshot)
gt_tbl <-
gtcars %>%
gt() %>%
cols_hide(contains("_"))
ui <- fluidPage(
gt_output(outputId = "table"),
actionButton("screenshot", "Screenshot gt"),
)
server <- function(input,
output,
session) {
output$table <-
render_gt(
expr = gt_tbl,
height = px(600),
width = px(600)
)
observeEvent(input$screenshot, {
shinyscreenshot::screenshot(id = "table")
})
}
if (interactive()) {
shinyApp(ui, server)
}