-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showSelected splits on 'built' data #145
Comments
Note, however, that this seems like a significant change that could have significant consequences for performance of the complier |
I got this data viz from your code http://bl.ocks.org/tdhock/raw/147f3bd1d465a9536a1b7a0face500cc/ yeah that is definitely surprising but for this simple example you can get the desired result by using plotList <- list(
plot = ggplot() + geom_bar(
data = d, aes(x, y, showSelected = z), stat = "identity", position="identity"
),
time = list(variable = "z", ms = 1000),
duration = list(z = 1000)
) Below is a more complicated example for which there is no workaround df <- data.frame(
letter = c(replicate(4, LETTERS[1:5])),
count = c(replicate(4, rbinom(5, 50, 0.5))),
stack = rep(rep(1:2, each = 5), 2),
facet = rep(1:2, each = 10)
)
gg <- ggplot() + geom_bar(
aes(letter, count, fill = stack, showSelected=facet),
data = df,
stat = "identity",
position="stack"
)
gg+facet_grid(facet ~ .)
complicated <- list(
plot = gg,
time = list(variable = "facet", ms = 1000),
duration = list(facet = 1000)
)
animint2dir(complicated) with position=stack http://bl.ocks.org/tdhock/raw/36cdacc1dbe5d5de894e2d05be92e327/ with position=identity http://bl.ocks.org/tdhock/raw/20d7879f055bd4670e8d3eb4a38e4e7a/ Rather than re-writing the compiler to compute "built" data for each showSelected subset, I think a better solution would be to re-code all the stats and position computations in the renderer. Then animint could support more kinds of interactive graphics, e.g. https://github.com/tdhock/animint/blob/master/inst/examples/stats.R |
Consider the following example:
I find the result a bit surprising. I assume it's because we split (by showSelected) on the 'built' data, but in this case, you'd really want to build/train on each subset of data.
The text was updated successfully, but these errors were encountered: