vega-lite
vega-lite copied to clipboard
Add 'row' and 'column' as resolve options for faceted charts
If a chart is faceted into columns and rows by two different variables, it is useful to have the scales be the same for each row or column. Currently it is only possible to select that all charts share the same scales or that they are all independent:
Shared
Open the Chart in the Vega Editor
Independent
Open the Chart in the Vega Editor
Desired
This is what resolve_scale(y='row')
would look like:
Interesting idea. I wonder whether it's easier to instead require people to write a facet of facet where the inner one has the resolve.
Thanks, that sounds like a useful workaround. I tried for a bit right now, but can't quite figure out where to place the resolve and from the last two comments in https://github.com/vega/vega-lite/issues/5960#issuecomment-590035177, it seems like nested facets have limited support (although that was two years ago). Do you have an idea of how to implement the workaround with my example above?
Unfortunately I have limited cycles right now and won't be able to check.
My idea right now is that we should make facet of facet work and implement your proposal as a macro.
I think we should work on making facet of facet work reliably first. Here is what I think your example would look like: Open the Chart in the Vega Editor. I'd have to dig into the Vega to see why the y-scales are not independent.
+1 for this, would like to use for matrix charts like https://vega.github.io/editor/#/gist/88d3491603f2568da0e93ead880e30dd/spec.json
Shared y scale across each row (but not column) would make it easier to scan across.