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

Emojis in GT Tables loses colors #889

Closed
billyfryer opened this issue Feb 11, 2022 · 2 comments
Closed

Emojis in GT Tables loses colors #889

billyfryer opened this issue Feb 11, 2022 · 2 comments

Comments

@billyfryer
Copy link

@billyfryer billyfryer commented Feb 11, 2022

Description

Whenever I try to save a {gt} table using the gtsave() function that contains an emoji from the {emoji} package, the saved emoji loses its color. I opened an issue there and was referred to here.

Reproducible example

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

library(emoji)
library(gt)

sample_data <- data.frame(Athlete = c("Alice", "Billy", "Charley"),
                          Medal = c("Silver", "Gold", "Bronze"))

data_w_emojis <- sample_data %>% 
  mutate(Medal = emoji::medal(Medal))

data_w_emojis %>% gt() %>% gtsave("No Colored Emojis.png")

Created on 2022-02-11 by the reprex package (v2.0.1)

Expected result

I should receive an output like this.

Session info

sessioninfo::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value
#>  version  R version 4.1.2 (2021-11-01)
#>  os       Windows 10 x64 (build 18362)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language (EN)
#>  collate  English_United States.1252
#>  ctype    English_United States.1252
#>  tz       America/New_York
#>  date     2022-02-11
#>  pandoc   2.14.0.3 @ C:/Program Files/RStudio/bin/pandoc/ (via rmarkdown)
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version date (UTC) lib source
#>  cli           3.1.1   2022-01-20 [1] CRAN (R 4.1.2)
#>  digest        0.6.29  2021-12-01 [1] CRAN (R 4.1.2)
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.1.2)
#>  fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.1.2)
#>  fs            1.5.2   2021-12-08 [1] CRAN (R 4.1.2)
#>  glue          1.6.1   2022-01-22 [1] CRAN (R 4.1.2)
#>  highr         0.9     2021-04-16 [1] CRAN (R 4.1.2)
#>  htmltools     0.5.2   2021-08-25 [1] CRAN (R 4.1.2)
#>  knitr         1.37    2021-12-16 [1] CRAN (R 4.1.2)
#>  magrittr      2.0.2   2022-01-26 [1] CRAN (R 4.1.2)
#>  reprex        2.0.1   2021-08-05 [1] CRAN (R 4.1.2)
#>  rlang         1.0.0   2022-01-26 [1] CRAN (R 4.1.2)
#>  rmarkdown     2.11    2021-09-14 [1] CRAN (R 4.1.2)
#>  rstudioapi    0.13    2020-11-12 [1] CRAN (R 4.1.2)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.1.2)
#>  stringi       1.7.6   2021-11-29 [1] CRAN (R 4.1.2)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.1.2)
#>  withr         2.4.3   2021-11-30 [1] CRAN (R 4.1.2)
#>  xfun          0.29    2021-12-14 [1] CRAN (R 4.1.2)
#>  yaml          2.2.2   2022-01-25 [1] CRAN (R 4.1.2)
#> 
#>  [1] C:/Users/billy/Documents/R/win-library/4.1
#>  [2] C:/Program Files/R/R-4.1.2/library
#> 
#> ------------------------------------------------------------------------------
@rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Mar 9, 2022

This is the unfortunate result of webshot rendering the PNG. It uses PhantomJS which is extremely old and unmaintained. Fortunately, work on the chromote and webshot2 packages is moving along. I’m planning on upgrading gtsave() to take advantage of all that (which would solve this problem as well).

@billyfryer
Copy link
Author

@billyfryer billyfryer commented Mar 14, 2022

Awesome! Can't Wait. Thanks so much!

@rich-iannone rich-iannone modified the milestones: v0.6.0, v0.7.0 Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants