Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slow table render when using data_bars #66

Open
RKonstantinR opened this issue Feb 2, 2024 · 0 comments
Open

slow table render when using data_bars #66

RKonstantinR opened this issue Feb 2, 2024 · 0 comments

Comments

@RKonstantinR
Copy link

The data_bar function is very slow in Shiny apps. For example, to display the mtcars table (32 rows) it takes about 6 seconds. On real datasets it takes much longer. This negatively impacts the user experience.

Is there a way to improve rendering speed in this case?

Attached is a reproducible example

library(shiny)
library(reactable)
library(reactablefmtr)
library(dplyr)

ui <- fluidPage(

    titlePanel("data bars"),
    
    mainPanel(
        reactableOutput("cars")
        )
    )

server <- function(input, output) {
    
    output$cars <- renderReactable({
        
        mtcars %>% 
            reactable(.,
                      groupBy = "carb",
                      defaultColDef = colDef(
                          # aggregate = "mean",
                          cell = data_bars(.,
                                           text_position = "above")
                          )
                      )
        })
    
    }

# Run the application 
shinyApp(ui = ui, server = server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant