I am quite new to diagrams and I would like to create finite state automata with it, as a replacement for TikZ. As far as I am aware there are no solutions for placing nodes easily along arrows, the FSM in one of the tutorials places the edge label in an ad-hoc fashion as regular nodes, but I would rather like to have something that works similar to TikZ - I don't want to think about the edge label positions in absolute terms. So I tried to patch up the Arrow module, extending it with edge labels that can be placed relative to the arrow and build an API around that.
My first approach was to patch connectPerim and connectOutside with named dummy diagrams at the calculated coordinates, calculate the position along the shaft and place some other diagram there. Then I saw that the placement is incorrect due to the head and tail and the required rescaling of the shaft. So the next thing I tried was extending ArrowOpts with an arrowLabel (which is an arbitrary diagram), and labelPos (between 0 and 1 along the shaft, 0 means at the tail, 1 at the head) and labelDist (distance in perpendicular direction from the shaft) and modifying the arrow' function accordingly. This approach does work more or less as I want, if the "base diagram" which gets the Arrows attached is not manipulated by scaling etc. after adding the edges.
In principle, this might be sufficient for my needs, but of course this is ugly and leaky, as one has to remember that everything falls apart when transforming the resulting diagram. So what I would like to achieve would be that rescaling the diagram afterwards also rescales the edge label nodes accordingly (and of course translations should also work as expected). So I started to digging into the rabbit hole with DelayedLeafs, but unfortunately I don't quite get it to work as I want. My approach was to make connectPerim/Outside variants that also create a delayed diagram and use information about "outer" transformations to adapt the diagrams stored in the arrowLabels accordingly, but I don't understand enough about the rendering process and how the whole structure is evaluated, etc. so I don't quite get it to behave correctly.
So my question is - should it be even possible to do what I want with the DelayedLeaf approach at all or am I wasting my time? Or is somebody already working on some nice solution for edge labels which I could rather use and contribute to? I attached the patched Arrow module, if somebody is interested.
Thanks and best regards,