vega / altair

Declarative statistical visualization library for Python
https://altair-viz.github.io/
BSD 3-Clause "New" or "Revised" License
9.27k stars 793 forks source link

docs: Make use of trellis/facet/repeated consistent #3178

Closed NickCrews closed 1 year ago

NickCrews commented 1 year ago

I notice that the examples and docs seem to use "trellis", "facet", and "repeated" inconsistently. Possible meanings:

a. "multiple subplots, each one showing a subset of the data" b. "mutiple subplots, each one showing a different variable" c. something else

The docs define these as

But the examples are inconsistent:

  1. https://altair-viz.github.io/gallery/strip_plot_jitter.html: doesn't uses any term to mean a
  2. https://altair-viz.github.io/gallery/us_incomebrackets_by_state_facet.html: uses facet to mean a
  3. https://altair-viz.github.io/gallery/trellis_area.html: uses trellis to mean a
  4. https://altair-viz.github.io/gallery/trellis_area_sort_array.html: uses trellis to mean a
  5. https://altair-viz.github.io/gallery/bar_chart_trellis_compact.html: uses trellis to mean a
  6. https://altair-viz.github.io/gallery/trellis_stacked_bar_chart.html: uses trellis to mean a
  7. https://altair-viz.github.io/gallery/trellis_scatter_plot.html: uses trellis to mean a
  8. https://altair-viz.github.io/gallery/trellis_histogram.html: uses trellis to mean a
  9. https://altair-viz.github.io/gallery/beckers_barley_trellis_plot.html: uses trellis to mean a
  10. https://altair-viz.github.io/gallery/beckers_barley_wrapped_facet.html: uses trellis and facet to mean a
  11. https://altair-viz.github.io/gallery/density_facet.html: uses facet to mean b
  12. https://altair-viz.github.io/gallery/scatter_marginal_hist.html: uses facet to mean c
  13. https://altair-viz.github.io/gallery/ridgeline_plot.html: doesn't uses any term to mean a
  14. https://altair-viz.github.io/gallery/anscombe_plot.html: uses trellis to mean a

I propose making these examples consistent with their definitions: a. Remove all uses of trellis, replacing with facet b. Use the term iff that is what the chart is doing

grepping through the codebase shows that the term "trellis" only appears in these examples, and in the vega-lite schema. So we could also file upstream to scrub "trellis" from there, but that might not be needed.

I can write a PR if this is a good idea. This would also be a great first PR for someone else.

joelostblom commented 1 year ago

Thanks for going through this thoroughly @NickCrews! I think facet, trells, and "small multiple" all align with the definition you have in a, while "repeated" aligns with the definition you have in b. It is great that the main documentation definitions are correct and it would be helpful with consistency throughout as you suggest. I think "trellis" is still a common term, so maybe we could mention it as a synonym where we define "facet" and then sync all the examples to only use facet? I'm happy to review a PR.

NickCrews commented 1 year ago

I agree with mentioning trellis in the definition of facet, but then avoiding it everywhere else.

That sounds like a good plan of action.