observablehq / feedback

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

Empty bin behavior in `group` #578

Closed hausdorff closed 1 year ago

hausdorff commented 1 year ago

binX optionally allows empty groups as a semi-hidden feature via filter: null. groupX and friends do not (as far as I know) have equivalent behavior. This makes sense since it's hard to know all the groups to zero out a priori. But for tip: true if you set (e.g.) x: { domain [...] }, you can get empty groups, and the gaps in interaction model are noticeable.

I could imagine a few solutions to this. One solution is to have an impute or something alongside the reducer APIs in marks like rect and bar. @mbostock suggests that group might take a domain, similar to the behavior of x. I do not have a clear sense of the implications of either change but my view is that something like impute is likely to be more generally useful and less duplicative. The disadvantage is that if you continue down that route you may end up re-implementing Arquero.

hausdorff commented 1 year ago

@mbostock asked to move this to Plot, so I'll close this in favor of the new issue: https://github.com/observablehq/plot/issues/1695