Dynamic Shape Generation

I’m trying to recreate something like this in Dash:

I was thinking I could use a bunch of rectangle and line shapes to do this, but I’m confused as to how or even if I can set up a dynamic number of shapes based on my data, which will change. All of the examples I’ve seen have a static number of shapes.

These are what I call interval data. They need to be at or span a certain width along my xaxis values.

After thinking about it a bit more, it’s pretty simple. I just looped through my pandas dataframe and created a list of dict shape objects and assigned that list to the shapes property of layout.

1 Like