That is a good question I saw that but did not dive in. The categories are implicitly assigned synthetic coordinates 1,2,3,4,... etc. I think the distance computation is somehow accumulating part of that as you go down the plot.