Closed mrcaseb closed 1 year ago
@mrcaseb I've added a gt_merge_stack_color()
function - the goal here is to avoid people trying to mix merge and stack with coloring rows - they're incompatible right now, as opposed to the dedicated function based off your suggestion.
set.seed(12345)
dplyr::tibble(
value = sample(state.name, 5),
color_by = seq.int(10, 98, length.out = 5)
) %>%
gt::gt() %>%
gt_merge_stack_color(value, color_by)
Sounds good to me, thank you for implementing!
Thanks for suggestion and some reprex code!
The current implementation of
gt_merge_stack()
fixes font colors which can be hard to read if color scales are used in cells.gt::cols_merge()
with an appropriate merge pattern can solve this. Maybegt_merge_stack()
can use it with a clever merge pattern?No auto font colors in
gt_merge_stack()
Automatic color adjustments in
gt::cols_merge()
Merge Pattern
I think the merge pattern could be more sophisticated and use html elements which would allow for more options to adjust the merge behavior. We could for example change line height for a line break, apply bold font to first column and reduce font size in second column with the following code