🏠 back to Observable

Adding graduated colour bars to existing chart

I’ve created a notebook that shows the chronology of the World’s constitutions, forked from a nice visualisation by @mbostock. I am trying to achieve something similar to this.

However, I’m a complete beginner to Observable and D3, and am a bit stumped on what I want to achieve next, as I want to add a bit more colour to this visualisation in a specific way: In the original, note that there are faded blue bars in the background, which start dark at every new constitution and fade to light when that constitution ends. If the constitution doesn’t have an end date, it just fades to the right edge of the chart and when there is no constitution in force the background is white.

Is the best way to tackle this to create a new dataset, just containing elements for these fading areas? If I do that, how should I overlay it beneath my current chart?