gauge_opacity: Gauge opacity

Description Usage Arguments Examples

View source: R/gauge.R

Description

Gauge opacity.

Usage

1
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

1
2
3
4
5
6
7
8
9
func <- cb("function(dist){
  if(dist > 60)
    return 1
  return .3
}")

g2(cars, asp(speed, dist, opacity = dist)) %>% 
  fig_point() %>% 
  gauge_opacity(callback = func)

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.