create_plot_ggiraph | R Documentation |
Creates a girafe object from a facetted ggplot bar plot for use in renderGirafe
create_plot_ggiraph(
data,
n_communes,
var_year,
var_commune,
unit,
var_cat,
var_values,
geom,
color_palette,
dodge = FALSE,
free_y = FALSE,
legend_title = NULL,
height_svg,
width_svg
)
data |
the data to provide |
n_communes |
number of selected communes, used to control the width of facets |
var_year |
the year variable |
var_commune |
the commune variable |
unit |
the unit to append in <var_values> |
var_cat |
the optional categorical variable |
var_values |
the variables containing the values |
geom |
the type of geom for the plot : either 'col' or 'line' |
color_palette |
a named vector of values-colors if <var_cat> is supplied, that should match <var_cat> items |
dodge |
if geom = 'col' and <var_cat> is supplied : controls whether the cols are in a stacked or dodge position |
free_y |
if <n_communes> is higher than 1, controls whether the y axis is independent for each facet or not |
legend_title |
a string containing the legend title if <var_cat> is supplied |
height_svg , width_svg |
dimensions of ggiraph output |
an interactive girafe object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.