glin / reactable

Interactive data tables for R
https://glin.github.io/reactable
Other
627 stars 80 forks source link

With `groupBy`, I was wondering if row names could be placed in the latest group instead of taking a full column. #379

Open olivroy opened 3 months ago

olivroy commented 3 months ago
library(reactable)
# https://github.com/glin/reactable/issues/94
mtcars |> 
  reactable(
    groupBy = c("cyl", "vs"),
    defaultExpanded = TRUE,
    columns = list(
      cyl = colDef(name = "", grouped = JS("
      function(cellInfo) {
        return cellInfo.value
      }"))

    )
  )

image

Like this, moved under the last group?

glin commented 3 months ago

It's not possible because of the way grouping is implemented, but similar ideas come up occasionally and I can group this with other feature requests about creating a flatter sort of "tree table": https://github.com/glin/reactable/issues/112, https://github.com/glin/reactable/issues/147

olivroy commented 2 months ago

Thanks! And this may relate to #383 . I think that rowGroupStyle has no effect.