This function extends ggiraph::girafe by allowing colour palettes to be globally specified.
Usage
girafe(
ggobj,
...,
char_limit = 200,
label_wrap_width = 80,
interactive = TRUE,
palette_codes = NULL,
priority_palette_codes = NULL,
ncol = NULL,
byrow = TRUE,
checked = NULL,
not_checked = NULL,
width_svg = NULL,
height_svg = NULL,
pointsize = 12
)
Arguments
- ggobj
ggplot2-object.
- ...
Dots forwarded to
ggiraph::girafe()
- char_limit
Integer. Number of characters to fit on a line of plot (legend-space). Will be replaced in the future with a function that guesses this.
- label_wrap_width
Integer. Number of characters fit on the axis text space before wrapping.
- interactive
Boolean. Whether to produce a ggiraph-plot with interactivity (defaults to TRUE) or a static ggplot2-plot.
- palette_codes
Optional list of named character vectors with names being categories and values being colours. The final character vector of the list is taken as a final resort. Defaults to
NULL
.- priority_palette_codes
Optional named character of categories (as names) with corresponding colours (as values) which are used first, whereupon the remaining unspecified categories are pulled from the last vector of
palette_codes
. Defaults toNULL
.- ncol
Optional integer or NULL.
- byrow
Whether to display legend keys by row or by column.
- checked, not_checked
Optional string. If specified and the fill categories of the plot matches these, a special plot is returned where not_checked is hidden. Its usefulness comes in plots which are intended for checkbox responses where unchecked is not always a conscious choice.
- pointsize, height_svg, width_svg
See
ggiraph::girafe()
.
Value
If interactive, only side-effect of generating ggiraph-plot. If interactive=FALSE, returns modified ggobj.
Examples
plot <- makeme(data = ex_survey, dep = b_1)
girafe(plot)