Should scaled constants be embedded in the data #29

Closed
hadley opened this Issue Aug 19, 2013 · 3 comments

Projects

None yet

2 participants

@hadley
Member
hadley commented Aug 19, 2013

Because we can't currently add constants to a scale: https://github.com/trifacta/vega/issues/103

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), 
  mark_symbol(),
  branch_smooth(props(stroke = "lm"), method = lm),
  branch_smooth(props(stroke = "loess"))
)
@wch
Contributor
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
Member
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
Contributor
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.
0386232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment