add_props: Add visual properties to a visualisation

Description Usage Arguments Examples

View source: R/ggvis.R

Description

Add visual properties to a visualisation

Usage

1
add_props(vis, ..., .props = NULL, inherit = NULL, env = parent.frame())

Arguments

vis

Visualisation to modify.

...

A set of name-value pairs. The name should be a valid vega property.

The first two unnamed components are taken to be x and y. Any additional unnamed components will raise an error.

.props

When calling props from other functions, you'll often have a list of quoted function functions. You can pass that function to the .props argument instead of messing around with substitute. In other words, .props lets you opt out of the non-standard evaluation that props does.

inherit

If TRUE, the defaults, will inherit from properties from the parent layer If FALSE, it will start from nothing.

env

The environment in which to evaluate variable properties.

Examples

1
2
3
mtcars %>% ggvis(~wt, ~mpg) %>% layer_points()
mtcars %>% ggvis() %>% add_props(~wt, ~mpg) %>% layer_points()
mtcars %>% ggvis(~wt) %>% add_props(y = ~mpg) %>% layer_points()

rpruim/ggvis2 documentation built on May 28, 2019, 2:34 a.m.