A couple thoughts#3
A couple thoughts#3cpsievert wants to merge 1 commit intorstudio:joe/feature/filterfrom cpsievert:joe/feature/filter
Conversation
| #' @export | ||
| filter_select <- function(id, label, sharedData, group, allLevels = FALSE, | ||
| filter_select <- function(id, label, sharedData, group = "default", allLevels = FALSE, | ||
| multiple = TRUE) { |
There was a problem hiding this comment.
@jcheng5 do we even need a group argument here? It could just derive from the sharedData's group property, right?
There was a problem hiding this comment.
This is a different kind of group--it's a group in the dplyr sense. The select box lets you choose subsets of the rows to display; the group argument indicates how those subsets should be determined. I know this is confusing, we can pick different/better names.
There was a problem hiding this comment.
the group argument indicates how those subsets should be determined
I don't follow. Would love an example.
|
I don't think the interactions in your GIF will be possible if the aggregation operations are performed in R, unless you use Shiny of course. If the aggregation was moved to plotly then it might be possible. But I'm imagining that for the near future these filter operations will only apply to, uh, un-aggregated displays of data. It's a serious limitation unfortunately. |
|
I should add that for aggregated displays I'd like to at least give an easy path to filtering those with Shiny, with a minimum of boilerplate. |
|
Yea, targeting the bar chart might be difficult. This example also brings up the question of how to handle multiple (nested) keys. For example, when I click on a bar, that selects a party, which has a one-to-many relationship in the electorate shown in the rest of the plots. |
|
Ooooh, I think I get it now, the group argument in |
|
@cpsievert (Sorry for the delay in replying, was consumed by talk prep for the last week) Yes, that's right, that's what the group argument does--it tells the filter how to divide the rows into those one-to-many (party-to-rows) relationships. |
I love the direction you're heading in @jcheng5! I have a lot of questions about
R/controls.R, and I'm sure you have a lot of ideas/opinions left to flesh out, so I'd love to pick your brain via this PR, and share some of my thoughts on how this should work. This gif is a good example of the type of interaction I'd like to enable: