The links that connect to the top and bottom will have the text to the right of the icon, and the links that connect to the right and left will have the text to the bottom of the icon.
I’m using the default layout right now (haven’t explicitly set one).
OK, apparently I misunderstood your situation – I thought that those purple things were nodes. But you mean for them to be labels on links, yes?
Assuming that’s the case, then I assume you don’t have any trouble defining that purple circle as a mid label on the link. GoJS Link Labels -- Northwoods Software
And presumably you know how to define the TextBlock as a separate label either to the side or underneath by setting GraphObject.segmentOffset, but not dynamically depending on the orientation of the link. So all you need to know is that you could define a subclass of Link that overrides the Link.computePoints method. Call the super method and remember the result. If the result is true, you can look at the Link.midAngle and decide which of the two GraphObject.segmentOffset values to set. Finally return the result of the super call.
I didn’t end up using midAngle, as my link routing is Orthogonal. Instead, I calculated the slope between the last two points, and placed the text accordingly. I also set toEndSegmentLength to ensure that the link is not segmented in the middle of my link decoration.