This would require quite a bit of additional work. Here's an outline of what you would have to do.
- Create two scales, one for the lower part and one for the upper. Set domains and ranges accordingly.
- Pass values to the lower scale, capping them at the maximum domain value such that bars that are longer will reach the maximum.
- Pass values to the upper scale, filtering those that are lower than the minimum.
You basically need to create two graphs that are aligned with each other to give the impression that there's just one. If you keep that in mind, doing it shouldn't be too difficult.
Here's a quick and dirty proof of concept that uses the linear scale's .clamp(true)
to prevent the bars from becoming too long for values outside the domain.