Gauge opacity.

gauge_opacity(g2, callback = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

callback

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

Examples

func <- cb("function(dist){ if(dist > 60) return 1 return .3 }") g2(cars, asp(speed, dist, opacity = dist)) %>% fig_point() %>% gauge_opacity(callback = func)