Skip to content
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

Permit multiple fields for row and columns channels #5903

Open
marcprux opened this issue Feb 13, 2020 · 5 comments
Open

Permit multiple fields for row and columns channels #5903

marcprux opened this issue Feb 13, 2020 · 5 comments
Labels
Blocked 🕐 For issues that are blocked by other issues Enhancement 🎉 P4 Nice to Have

Comments

@marcprux
Copy link
Member

Being able to arbitrarily facet on multiple fields is very useful in data exploration. It is currently possible to facet on at most 2 fields (one in row and one in column) using the faceting shorthand encoding channels, even through it is possible to nest hconcat and vconcat layers arbitrarily deep.

It would be useful if the row and column channels could accept more than one field in order to generate deep layer nests. Among other uses, this could enable simple hierarchical groupings of separate related categorical fields. E.g.:

{
  "data": {"url": "data/birdstrikes.json"},
  "mark": {"type": "line"},
  "encoding": {
    "row": [
      {"field": "Wildlife__Size", "type": "nominal"},
      {"field": "Wildlife__Species", "type": "nominal"}
    ],
    "x": {"field": "Flight_Date", "type": "temporal", "timeUnit": "year"},
    "y": {"field": "Cost__Other", "aggregate": "sum", "type": "quantitative"}
  }
}

It seems like the resulting layer transformations could easily be applied recursively for each additional facet encoding.

@domoritz
Copy link
Member

Vega-Lite already supports facets of facets using the facet operator. I read this as a feature request to support arrays in the shorthand notion and translate to a nested faceted spec (and make sure the nesting actually works). Does that make sense?

@marcprux
Copy link
Member Author

marcprux commented Feb 13, 2020 via email

@kanitw kanitw added Blocked 🕐 For issues that are blocked by other issues P4 Nice to Have labels Feb 13, 2020
@kanitw
Copy link
Member

kanitw commented Feb 13, 2020

Vega-Lite already supports facets of facets using the facet operator

We actually do NOT have an official support for it in the JSON schema yet, since it doesn't always behave correctly. See #2775.

Thus, we shouldn't implement this until nested facet always works correctly.

@domoritz
Copy link
Member

Sorry, I should have been more clear. Vega-Lite conceptually supports nesting facets. The implementation has some bugs so we don't support it yet.

@bigfacewo
Copy link

Hi.
This issue has not been closed. I would like to know how the issue is progressing.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked 🕐 For issues that are blocked by other issues Enhancement 🎉 P4 Nice to Have
Projects
None yet
Development

No branches or pull requests

4 participants