Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rownames_to_stub + opt_interactive() #1706

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# gt (development version)

* `opt_interactive()` now shows row names if `rownames_to_stub = TRUE` (@olivroy, #1702).

* `data_color()` throws a more informative error message if `rows` didn't resolve to anything (@olivroy, #1659).

* PDF output now allows the font size of a table to be set using the table.font.size parameter in the tab_options function (#1472). The font sizes of individual table cells (including those in the body, stubs, column headings, etc.) can be set using tab_style function. Several other options specified in tab_style are now reflected in PDF output.
Expand Down
4 changes: 3 additions & 1 deletion R/render_as_i_html.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ render_as_ihtml <- function(data, id) {
column_labels_border_bottom_width <- opt_val(data = data, option = "column_labels_border_bottom_width")
column_labels_border_bottom_color <- opt_val(data = data, option = "column_labels_border_bottom_color")

rownames_to_stub <- stub_rownames_has_column(data)

emoji_symbol_fonts <-
c(
"Apple Color Emoji", "Segoe UI Emoji",
Expand Down Expand Up @@ -452,7 +454,7 @@ render_as_ihtml <- function(data, id) {
data = data_tbl,
columns = col_defs,
columnGroups = colgroups_def,
rownames = NULL,
rownames = rownames_to_stub,
groupBy = NULL,
sortable = use_sorting,
resizable = use_resizers,
Expand Down
Loading