data.validator icon indicating copy to clipboard operation
data.validator copied to clipboard

render_semantic_report_ui prevents side scrolling for DT tables

Open nick-youngblut opened this issue 2 years ago • 0 comments

Guidelines

  • [X] I agree to follow this project's Contributing Guidelines.

Project Version

0.2.0

Platform and OS Version

macOS 13.3

Existing Issues

No response

What happened?

Once the validation report is rendered in a shiny app, the user cannot side scroll for DT tables with many columns. It appears that rendering of the report fixes the webpage size and prevents any side scrolling. This occurs even if the DT table and report are on different tab panels.

Steps to reproduce

Relevant server.R code:

library(shiny)
library(data.validator)
library(DT)

server = function(input, output, session) {
  # skipped lines...

  report = reactive({
    req(tbl())
    report = data_validation_report()
    validate(tbl(), name = "Verifying samples table") %>%
      validate_if(is_uniq(Sample_ID), 
                  description = "Sample ID column is unique") %>%
      validate_cols(not_na, 
                    description = "No NA values") %>%
      add_results(report)
    return(report)
  })
  ## render report
  output$validation = renderUI({
    req(report())
    render_semantic_report_ui(get_results(report()))
  })
}

Relevant ui.R code:

library(shiny)
library(data.validator)
library(DT)

ui = fluidPage(
  tabsetPanel(
    tabPanel('Data Input',
      fileInput("samples_file", "Samples file", 
              accept=c(".csv", ".tsv", ".xlsx")),
      actionButton("submit_button", "Submit"),
    ),
    tabPanel('Samples table',
      dataTableOutput('samples_table')
    ),
    tabPanel('Table validation',
      uiOutput("validation")
    )
  )
)

Expected behavior

I would like to render the validation report but still be able to side scroll through all columns in the DT table that is rendered in the app.

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

nick-youngblut avatar Aug 28 '23 21:08 nick-youngblut