Skip to content

Reactable - #14

Open
mplasmans wants to merge 2 commits into
developfrom
reactable
Open

mplasmans wants to merge 2 commits into
developfrom
reactable

Conversation

@mplasmans

Copy link
Copy Markdown
Contributor

Reactable tabel toegevoegd in dezelfde stijl als de DT table.

Comment thread R/ro_reactable_theme.R
#'
#' shinyApp(ui, server)
#' }
ro_reactable_css <- function(sorting = TRUE) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this default as sorting = FALSE, so it is aligned with the ro_reactable_theme default (and also with Laurens-table opinion).

local_mocked_bindings(
ro_check_if_font_available = function(target_font_family) "Verdana"
)
css <- ro_dt_theme()$children[[1]]$children[[1]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is using the ro_dt_theme instead of the ro_reactable_theme


test_that("ro_reactable_theme errors for an unavailable custom font", {
expect_error(
ro_dt_theme(base_family = "Not an installed font"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is using the ro_dt_theme instead of the ro_reactable_theme

Comment thread R/ro_reactable_theme.R
#' shinyApp(ui, server)
#' }
ro_reactable_css <- function(sorting = TRUE) {
arrow_css <- if (sorting) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something for now, but maybe for the future(?):
Do you think its possible to have one css function for the arrow-theming, which then can be applied to both reactable and DT? In that way, it would be possible to keep the arrow-theming in one place. (Or maybe even more broadly, for the table theming in general).
@mplasmans @hypebright What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds like a good idea @tkranenburgrivm! Keeps it DRY. We would also need to make sure that we avoid hard-coding any colors that are organisation-dependent. E.g. #44688f, #f2f2f2 and #007bff instead of coming from ro_color()? Or is that overkill and not relevant for an arrow @mplasmans 🤓?

Comment thread R/ro_reactable_theme.R
) {
check_string(base_family)

base_family <- ROvis.utils::ro_check_if_font_available(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something minor (I'm not sure if it has impact on anything): The gt and DT theme call it without the ROvis.utils::. It's already loaded with the NAMESPACE importFrom

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already imported here:

#' @importFrom ROvis.utils ro_check_if_font_available
so no need to put importFrom here or call ROvis.utils::

@tkranenburgrivm

Copy link
Copy Markdown
Collaborator

@mplasmans Hi Marjanne, super cool you are adding the reactable to the package! I hope this will help a lot with updating the VZinfo dashboards in the future.

I left some comments on the code, and I will leave some future suggestions here. But I would say the code itself looks good, so good by me to merge:)
Anyway, some future improvements (@mplasmans and @hypebright, we can see if these deserve to be on the Issue-board later?)

  • reactable isn't included in the vignette yet
  • ro_reactable_theme() doesnt have a test yet. But im not sure how bad it is, considering it is just css.
  • Would you like a ro_reactable_table function, to add the additional stuff in it?
  • The DT table has accessibility features added to it, but reactable not yet. I will check what was the original feedback list, and check with Annette what the additions of the sorting-arrows do to accessibility. (From the top of my head it including things like table caption, pagination with the right aria-labels, how the html is build up, page numbering in NL, etc.). I think we can and should still expand on the accessibility for the reactable, but that shouldnt stop us from merging your new styling function!

@hypebright

hypebright commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Nice @mplasmans!! I took a little peek at it even though @tkranenburgrivm is the reviewer because I was tagged anyway 😄.

Yes to the vignette, that would be great (can be separate issue indeed), also to include it in the README. Make sure people know it's there. I think the other points also make sense and deserve a spot in the board. The theme can have a test in this PR (this is nice for test coverage percentage 👼 ).

@hypebright

Copy link
Copy Markdown
Contributor

By the way, this closes #10 right?

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

3 participants