Closed Cattiva closed 9 months ago
Never mind, just found out about gt::fmt_icon
and the gt::from_column
function from gt
release 0.10.0. The following code does work without gtExtras and does exactly what I want:
tibble::tibble(
fa_icon = "circle-check",
fill_color = "darkgreen"
) |>
gt::gt() |>
gt::fmt_icon(
fa_icon,
fill_color = gt::from_column("fill_color")
)
I mean, the bug still persists in gtExtras
but the function gt_fa_column
seems redundant now, so no fix needed for me.
Thank you anyway for your awesome work :)
Thanks for reporting! I agree that if you can get the function "upstream" that's the way to go!
However, I also can't reproduce the issue locally, as it seems to be working 🤷
tibble::tibble(
fa_icon = "circle-check"
) |>
gt::gt() |>
gtExtras::gt_fa_column(
fa_icon
) |>
gtExtras::gt_reprex_image()
Created on 2024-02-04 by the reprex package (v2.0.1)
I'm still seeing the same thing after updating {gt} to 0.10.1 Running Tom's reprex: above:
tibble::tibble(
fa_icon = "circle-check"
) |>
gt::gt() |>
gtExtras::gt_fa_column(
fa_icon
) |>
gtExtras::gt_reprex_image()
Having tried the new gt::fmt_icon() function, I still need the gt_fa_column() function for a use case where only some rows have an 'attention' icon and others are left blank. Hoping you can re-open this issue and see if it's a relatively easy fix to get it working with {gt} 0.10.1.
Prework
Description
The function
gt_fa_column
outputs some R code as text instead of the desired icon. I'm using the function once per quarter and today I experienced this strange behavior. I'm running R on Ubuntu for WSL, but the problem stays on Windows.Reproducible example
Consider the following example:
This yields the following table:
Running the example from the manual page leads to the same bug. However, the call to the
fontawesome::fa()
function seems to work just fine:Converts it to
and running without
gt::html()
outputs the correct icon.Expected result
I would expect to see the icon
circle-check
in the columnfa_icon
like in my previous tables:Session info