Here’s an attempt which just generates several Sankey diagrams and then lines them up with the SVG transform attribute (forked from @mbostock’s Flow-o-matic):
The trickiest part is figuring out how to pick the size of the “next” Sankey diagram so that the corresponding bars have equal heights.
I tried to keep the manual fiddling to a minimum, but there are definitely still some things I could do to make the code more general. Hopefully you get the idea though…