observablehq / feedback

Customer submitted bugs and feature requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

markwhiting opened this issue · comments

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.

Please upvote observablehq/plot#8 if you are interested in this feature. Thank you!

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

Closing as duplicate per #602 (comment).