observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Plot facets don't appear to be able to remove categorical scale intervals for categories that are empty in some facets #602

Closed markwhiting closed 1 month ago

markwhiting commented 8 months ago

I am trying to create a facet where quality scores on several features are grouped by a type variable. So, on x I have a float quality, on y I have the names of the features, and on the facet fy, I have a type variable. What is unexpected (and used to be possible in the prior facet system, as far as I know) is that it appears to be impossible to have different categorical scales across the facets.

Here's an example. In this figure the "behavior" facet should not include the "financial" row, but there appears to be no way to remove it without effectively generating multiple plots and sticking them together.

untitled-19

I believe this was possible in earlier versions of plot, and it is possible in many standard visualization libraries, e.g., in Vega-lite via independent resolution of scales or in ggplot via the scales = "free" argument. These solutions are both rather simple. In the context of plot, allowing for a declaration of the flexibility of scales in a top-level facet specification would be one possible approach.

mbostock commented 8 months ago

Please upvote https://github.com/observablehq/plot/issues/8 if you are interested in this feature. Thank you!

markwhiting commented 8 months ago

Thanks @mbostock — is it best to also close this?

mootari commented 1 month ago

Closing as duplicate per https://github.com/observablehq/feedback/issues/602#issuecomment-1778415271.