vega-lite
vega-lite copied to clipboard
Permit multiple fields for row and columns channels
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.
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?
Precisely.
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 https://github.com/vega/vega-lite/issues/2775.
Thus, we shouldn't implement this until nested facet always works correctly.
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.
Hi. This issue has not been closed. I would like to know how the issue is progressing. Thank you.