This visualization demonstrates frustrations with the vega-lite-api in trying to get the sort order of stacking to match the sort order of the color scale. Notice that the ordering of the color legend is correct (a custom sort order), but the order of the layering does not match it.