Black Lives Matter. Please consider donating to Black Girls Code today.

Multiple rectangles horizontally for categorial variables


My data are as follow
{“proteinX”: [“DomainA”,“DomainC”],
“proteinN”:[“DomainB”,“DomainC”, “DomainC”],

I want to plot on Y axis what protein it is and on X axis rectangles with domain name same order as given in the list.

I was unable to solve this problem with any of the plotting libraries. Is there an easy way to do this with plotly ?

P.S Y axis is always unique and categorial, X axis is not unique (repeats possible) also categorial and order is important. Annotation is also needed for X and text inside rectangle for Y.