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),
branch_smooth(props(stroke = "lm"), method = lm),
branch_smooth(props(stroke = "loess"))
Seems reasonable, but maybe we should wait to see what the vega guys decide to do about it first?
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?
props(fill = "colour")
This works as of 4965233. The new syntax is:
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
layer_model_predictions(stroke = "lm", model = "lm") %>%
layer_model_predictions(stroke = "loess", model = "loess")
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.