From ba33e54fc4f8e4524aaf9c6b7b136cc10475f567 Mon Sep 17 00:00:00 2001 From: Stefan Petkov Date: Tue, 20 Jan 2026 15:40:10 +0100 Subject: [PATCH 1/3] feat: add pagination to key metric table --- R/key_table.R | 3 ++- R/tables.R | 14 +++++++++++--- inst/quarto/quality_metrics.qmd | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/R/key_table.R b/R/key_table.R index f73e942..865de49 100644 --- a/R/key_table.R +++ b/R/key_table.R @@ -389,7 +389,8 @@ key_metric_table <- table_content %>% style_table( escape = FALSE, - tooltips = TRUE + tooltips = TRUE, + pageLength = 10 ) } diff --git a/R/tables.R b/R/tables.R index 09b6a1b..8d9d5e4 100644 --- a/R/tables.R +++ b/R/tables.R @@ -43,7 +43,9 @@ style_table <- function( pixelatorR:::assert_single_value(buttons, "bool") # Options - opts <- list(pageLength = ifelse(is.null(pageLength), nrow(df), pageLength)) + opts <- list( + pageLength = ifelse(is.null(pageLength), nrow(df), pageLength) + ) dom <- "" @@ -103,16 +105,22 @@ style_table <- function( ") } - opts$dom <- dom + # Build extensions list + extensions <- c() + if (buttons) extensions <- c(extensions, "Buttons") + if (length(extensions) == 0) extensions <- list() + table_widget <- DT::datatable( df, caption = caption, rownames = FALSE, escape = escape, options = opts, - extensions = if (buttons) "Buttons" else list(), + extensions = extensions, + class = "display compact", + width = "100%", ... ) diff --git a/inst/quarto/quality_metrics.qmd b/inst/quarto/quality_metrics.qmd index 0b85676..2328946 100644 --- a/inst/quarto/quality_metrics.qmd +++ b/inst/quarto/quality_metrics.qmd @@ -13,7 +13,7 @@ execute: ```{r} #| label: key_metrics #| results: 'asis' -key_metric_table(qc_metrics_tables, detailed = FALSE) +key_metric_table(qc_metrics_tables, detailed = FALSE, pageLength = 10) ``` From 3daba43d2c6a1199baa6015745d93b1705581cf9 Mon Sep 17 00:00:00 2001 From: Stefan Petkov Date: Tue, 20 Jan 2026 15:40:43 +0100 Subject: [PATCH 2/3] chore: update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024fb6e..20259c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] 2025-12-09 ### Updated -- The key metrics table is now in long format to avoid horizontal scrolling with high number of samples. +- The key metrics table is now in long format to avoid horizontal scrolling with high number of samples. Pagination has also been added to prevent very long tables from being displayed. ### Fixed - The ES now tolerates chunk errors and will in most cases render a report even if some chunks fail. From eb947a4bfc70c0ea9ac8f8f38a5b85ee5bfb2d00 Mon Sep 17 00:00:00 2001 From: Stefan Petkov Date: Tue, 20 Jan 2026 18:39:24 +0100 Subject: [PATCH 3/3] fix: remove pageLength param from key_metric_table --- inst/quarto/quality_metrics.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/quarto/quality_metrics.qmd b/inst/quarto/quality_metrics.qmd index 2328946..0b85676 100644 --- a/inst/quarto/quality_metrics.qmd +++ b/inst/quarto/quality_metrics.qmd @@ -13,7 +13,7 @@ execute: ```{r} #| label: key_metrics #| results: 'asis' -key_metric_table(qc_metrics_tables, detailed = FALSE, pageLength = 10) +key_metric_table(qc_metrics_tables, detailed = FALSE) ```