Sorting stacked bars by value of a stack: Plotly Graph Objects

Hi, I am new to Plotly and am trying to sort a stacked bar chart in ascending or descending order. I don’t want to sort by the total height of each bar; each bar is the same height, 100%. Rather, I would like to sort the bars by one of the three categories that comprises each stack (for example, by the dark blue stack of each bar).


Is there a simple way to do this? I am using graph_objects and my data is in long format.