You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
library(magrittr)
library(ggvis)
mtcars %>%
ggvis() %>%
group_by(gear) %>%
layer_bars(
x = ~factor(cyl),
y = ~mpg,
fill = ~factor(gear),
width = 1
) %>%
scale_ordinal('x')
Error is: Error in UseMethod("prop_label") : no applicable method for 'prop_label' applied to an object of class "NULL"
But the following does:
library(magrittr)
library(ggvis)
mtcars %>%
ggvis( #specifying the x and y here now, instead of later
x = ~factor(cyl),
y = ~mpg
) %>%
group_by(gear) %>%
layer_bars(
fill = ~factor(gear),
width = 1
) %>%
scale_ordinal('x')
Even the following works:
library(magrittr)
library(ggvis)
mtcars %>%
ggvis(
x = ~hp,
y = ~mpg
) %>%
group_by(gear) %>%
layer_bars(
x = ~factor(cyl),
y = ~mpg,
fill = ~factor(gear),
width = 1
) %>%
scale_ordinal('x')```
i.e. layer_bars works only if x and y are initially set in the initial ggvis call.
The source code for layer_bars seems to ask for 'x.update', which I'm guessing only works if x is initially defined.
This does not seem to be the case for layer_points, i.e.
library(magrittr)
library(ggvis)
mtcars %>%
ggvis() %>%
layer_points(
x = ~factor(gear),
y = ~mpg
) %>%
scale_ordinal('x')
works fine.
In my opinion, this should be made consistent... if some marks allow for empty initial values for props, I think all of them should?
Also: thank you, to the entire team, for making such a great contribution to the data community. I know this isn't high on your priority list right now, but there are definitely people out there who love ggvis and are hoping for further development.
The text was updated successfully, but these errors were encountered:
The following does not work:
Error is:
Error in UseMethod("prop_label") : no applicable method for 'prop_label' applied to an object of class "NULL"
But the following does:
Even the following works:
i.e.
layer_bars
works only ifx
andy
are initially set in the initialggvis
call.The source code for
layer_bars
seems to ask for'x.update'
, which I'm guessing only works ifx
is initially defined.This does not seem to be the case for
layer_points
, i.e.works fine.
In my opinion, this should be made consistent... if some marks allow for empty initial values for props, I think all of them should?
Also: thank you, to the entire team, for making such a great contribution to the data community. I know this isn't high on your priority list right now, but there are definitely people out there who love
ggvis
and are hoping for further development.The text was updated successfully, but these errors were encountered: