Skip to content

Commit

Permalink
change min width for summary tables
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Nov 30, 2023
1 parent c605777 commit 5af4472
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
10 changes: 7 additions & 3 deletions R/funcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ tab_fun <- function(dat, yrrng, fntsz = 14, family, rowgrp = c('Primary', 'Gener
collevs <- c('Restoration', 'Enhancement', 'Protection')
collabs <- c('Restoration (Ac / Mi)', 'Enhancement (Ac / Mi)', 'Protection (Ac / Mi)')

habmin <- 80

# only unique step for primary habitat categories
if(rowgrp == 'Primary'){

Expand All @@ -34,6 +36,8 @@ tab_fun <- function(dat, yrrng, fntsz = 14, family, rowgrp = c('Primary', 'Gener
collevs <- grep('Restoration|Enhancement', collevs, value = T)
collabs <- grep('Restoration|Enhancement', collabs, value = T)

habmin <- 180

}

# data prep
Expand Down Expand Up @@ -123,12 +127,12 @@ tab_fun <- function(dat, yrrng, fntsz = 14, family, rowgrp = c('Primary', 'Gener
tab <- reactable(
totab,
columns = list(
rowgrp = colDef(name = 'Habitat', minWidth = 180, class = 'sticky left-col-1-bord', headerClass = 'sticky left-col-1-bord', footerClass = 'sticky left-col-1-bord'),
tot = colDef(name = 'Total projects', minWidth = 80)
rowgrp = colDef(name = 'Habitat', minWidth = habmin, class = 'sticky left-col-1-bord', headerClass = 'sticky left-col-1-bord', footerClass = 'sticky left-col-1-bord'),
tot = colDef(name = 'Total projects', minWidth = 70)
),
defaultColDef = colDef(
headerStyle= list(fontSize = fntsz, fontFamily = family),
minWidth = 150,
minWidth = 100,
resizable = TRUE,
style = function(value, index) {
if (index == nrow(totab))
Expand Down
Loading

0 comments on commit 5af4472

Please sign in to comment.