Gauge colour, similar to the scale_colour_* family of functions from the ggplot2 package.

gauge_color(g2, colors = NULL, callback = NULL)

gauge_color_viridis(g2, option = c("viridis", "magma", "plasma",
  "inferno", "cividis"), reverse = FALSE, callback = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

colors

A vector of colors.

callback

A JavaScript callback function (see cb) which returns a color.

option

Palette name.

reverse

Whether to reverse the palette.

Examples

g2(mtcars, asp(mpg, qsec, color = drat)) %>% fig_point() %>% gauge_color(c("red", "white", "blue"))