Open fgregg opened 10 months ago
The GitHub Burndown chart does something like this by converting an interval into a regular pulse (e.g., daily value). It’s not technically possible to stack rects with overlapping but non-aligned intervals because the resulting stacked shape is no longer a rect. For example, say you have two intervals represented in ASCII art:
aaaaaaaaaa
bbbb
If you were to stack a on top of b, the shape for a would no longer be a rectangle:
aaaa
aaaabbbbaa
The stack transform doesn’t require that the independent dimension (normally x) is regular, so you wouldn’t have to take the pulse approach used in the linked notebook — you could instead cut every interval when it overlaps with another interval. And then the stack transform would work. Maybe the bin transform could do something fancy here to replicate data that spans multiple bins.
this is the behavior i’d like to see:
aaaa
aaaabbbbaa
and you are absolutely right that is not a rect anymore, so it probably shouldn’t be something you can do with rects.
however, stacking up bits of area of different widths would still be really useful! at least to me.
Currently, if two rects do not share an x1 and x2, they will not stack, it would be great if they did!
Here's an example of something i would like to stack but is not:
https://observablehq.com/@fgregg/chicago-shelter-eviction-rates@129
I manually set offsets to look like this:
https://observablehq.com/@fgregg/chicago-shelter-eviction-rates@171