Skip to content

slow table render when using data_bars #66

@RKonstantinR

Description

@RKonstantinR

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions