Wraps a constant in a JavaScript function as most underlying JavaScript functions expect it.

constant(x)

Arguments

x

A constant.

Examples

# create plot g <- create_globe() %>% globe_img_url() %>% bars_data(quakes) %>% bars_lat("lat") %>% bars_lon("long") # passing a constant straight does not work
# NOT RUN { bars_color(g, "red") # }
# using `constant` it works RED <- constant("red") bars_color(g, RED)