Should scaled constants be embedded in the data #29

hadley opened this Issue Aug 19, 2013 · 3 comments


None yet

2 participants

hadley commented Aug 19, 2013

Because we can't currently add constants to a scale:

Then it would work the same way as reactive constants.

Scaled constants are useful for cases like this:

ggvis(mtcars, props(x ~ wt, y ~ mpg), 
  branch_smooth(props(stroke = "lm"), method = lm),
  branch_smooth(props(stroke = "loess"))
wch commented Aug 19, 2013

Seems reasonable, but maybe we should wait to see what the vega guys decide to do about it first?

hadley commented Aug 29, 2013

The only problem is that it's now easy to do props(fill = "colour") which creates an invalid vega spec which just doesn't render. Maybe we need to at least throw an error?

@hadley hadley added this to the vega milestone Feb 7, 2014
wch commented May 23, 2014

This works as of 4965233. The new syntax is:

mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
  layer_points() %>%
  layer_model_predictions(stroke = "lm", model = "lm") %>% 
  layer_model_predictions(stroke = "loess", model = "loess")
@wch wch closed this May 23, 2014
@davechilders davechilders pushed a commit to davechilders/ggvis that referenced this issue Oct 9, 2015
Dave Childers Remove 'note' from properties-scales vignette
The example works for me using ggvis version 0.4.2. And the associated
issue rstudio#29 has been closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment