I'm trying to use {{gt}} in conjunction with {{shinyscreenshot}}. The resulting screenshot seems to crop numeric columns:
Is this due to rendering in the gt package or caused by shinyscreenshot and how can this be avoided?
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)
}
this worked: saves the gt as temp file and uses file.copy to download