-
Notifications
You must be signed in to change notification settings - Fork 85
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
plots in gt
tables disappear on send
#58
Comments
Update, the HTML file I saved from the RStudio preview pane worked fine for me, but did not render for my colleague who I sent it to - so now I'm suspecting browser issues. Is there a good way of sending table/plot data with Blastula? |
This is an issue where we need to build functionality for deploying images to some sort of CDN. We can do this manually right now with the |
@GregSutcliffe Please have a look at a temporary workaround (which is to become a permanent solution) in #87. |
Thanks @rich-iannone! I've had a play with the new branch on Blastula, looks nice - I can confirm the simple example of sending a single plot works for me. Bravo :) However, I'm unclear on how to apply this to GT with embedded images. I have a working GT table, ~20 rows, each with a sparkline plot in the last column, like this: That is saved as object
Then all I get is a page of HTML in my email, rather than a table. If I instead use Am I missing something? Or is the usecase for GT simply not ready for use yet (which would be fine, to be clear)? |
Would you able able to provide all the code for this? I can test it out and see what the problem is. What happens if you don’t include the sparkline column? |
@rich-iannone here you go - https://gist.github.com/GregSutcliffe/207297b94ee4abc95412bd9c6c5911e5 Given |
Forgot to answer this - sorry. So I commented out lines 62:64 and added 1 - still produces raw HTML |
In the events <-
new_events %>%
left_join(past_events,by='name') %>%
mutate(sparkline = plot %>% .[[1]] %>% ggplot_image(aspect_ratio = 2, height = 60)) %>%
select(-plot) %>%
gt() %>%
fmt_markdown(columns = vars(sparkline)) %>%
cols_label(
sparkline = "RSVP history",
) %>%
tab_options(
table.width = pct(100)
) Which got me a table with a plot column. The next step is to use this: email_object <-
compose_email(
body = md(events %>% as_raw_html(inline_css = TRUE)),
footer = "Yay"
) To get the email. The problem seems to lie in gt's |
So to clarify, you're also seeing the problem in Assuming yes, then it looks like a case of waiting for that issue with |
Not sure if it helps you now. I had the same issue and the ggplots would not render in the gt table in the email. I used print() instead of as_raw_html() and it worked. |
hi, |
I'm using this example to render
ggplot
sparklines in agt
table, and then trying to send that table viablastula
.The table renders fine in RStudio, as does an email object containing it, e.g:
The viewer pane will correctly show the sparklines. However, when I call
smtp_send()
with my GMail credentials, the resulting email does not display the plots - the column is blank.I'm sure I'm just doing something stupid, any debugging tips?
The text was updated successfully, but these errors were encountered: