Empty bin behavior in `group`
hausdorff opened this issue · comments
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.
@mbostock asked to move this to Plot
, so I'll close this in favor of the new issue: observablehq/plot#1695