get_infographic = function(df, id, disag, lang){
session = shiny::getDefaultReactiveDomain()
if (get_ind_type(id) == "percent") {
shinyjs::show("disag")
title =
whesApp::indicator_info %>%
dplyr::filter(.data$ind_id == id) %>%
dplyr::pull(.data$name)
df %>%
tr_table(whesApp::translate_db, lang) %>%
prep_waffle(disag) %>%
create_waffle(disag,
title = tr_pull(whesApp::translate_db,
key = id,
lang = lang,
search = TRUE),
caption = glue::glue(tr_pull(whesApp::translate_db,
key = "caption",
lang = lang),
"\n",
tr_pull(whesApp::translate_db,
key = caption_source(
ind = id),
lang = lang)),
legend_labels = tr_pull(whesApp::translate_db,
key = "waffle_legend_label",
lang = lang),
plot_width = get_plot_width(df, id, disag),
lang = lang)
} else {
shinyjs::hide("disag")
df %>%
prep_valuebox(lang = lang) %>%
create_valuebox(caption = glue::glue(tr_pull(whesApp::translate_db,
key = "caption",
lang = lang),
"\n",
tr_pull(whesApp::translate_db,
key = caption_source(
ind = id),
lang = lang)))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.