Skip to content

Conversation

@llrs-roche
Copy link
Contributor

@llrs-roche llrs-roche commented Sep 4, 2025

Pull Request

Part of insightsengineering/teal.modules.clinical#1420

This PR makes table_with_settings_srv work well for gtsummary tables so that they can be expanded in a modal.

Example:

library(shiny)
library("gtsummary")
library(magrittr)

ui <- bslib::page_fluid(
  table_with_settings_ui(
    id = "table_with_settings"
  )
)

server <- function(input, output, session) {
  table_r <- reactive({
    table <- trial |>
      tbl_summary(by = trt, include = c(trt, age, grade, response)) |>
      add_n(last = TRUE, col_label = "All patients", statistics = "{N_obs} ({p_nonmiss}%)")
  })
  
  table_with_settings_srv(id = "table_with_settings", table_r = table_r)
}

if (interactive()) {
  shinyApp(ui, server)
}

TODO:

  • The download formats doesn't work with: Error in : unable to find an inherited method for function 'matrix_form' for signature 'obj = "tbl_summary"'. The function type_download_srv_table should be updated too.
  • Make table_with_settings_srv compatible with the previous output format: rtables
  • Update tests

@llrs-roche llrs-roche added the core label Sep 4, 2025
@llrs-roche llrs-roche marked this pull request as draft September 4, 2025 10:45
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Unit Tests Summary

  1 files   15 suites   1m 50s ⏱️
123 tests 118 ✅ 0 💤  2 ❌ 3 🔥
320 runs  305 ✅ 0 💤 12 ❌ 3 🔥

For more details on these failures and errors, see this check.

Results for commit 65d0c8b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
table_with_settings_ui 💔 $32.94$ $+1.09$ $0$ $0$ $+12$ $0$

Results for commit c450cb6

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants