varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.39k stars 78 forks source link

Changing arrow lengths #18

Closed vikraman closed 3 years ago

vikraman commented 4 years ago

Would it be possible to have a slider to change arrow lengths? This could be achieved using the tikzcd shorten option, and is very useful for the 2-arrows in pasting diagrams.

varkor commented 4 years ago

I agree this would be useful, especially for 2-cells. The question is what the different possible settings should be. I'll probably add this after #5, because I'm having to rewrite the arrow drawing code for that anyway.

varkor commented 3 years ago

The difficulty with this feature is that shorten in TikZ does not behave well for curved arrows (see this TeX.SE answer, for instance). I'd rather implement a version that works well in any situation, but I need to investigate if that's even possible. If possible, I'd also like a shorten that accepts a percentage rather than an absolute length.

The arrow library in quiver already has the ability to shorten.

varkor commented 3 years ago

This was added in https://github.com/varkor/quiver/commit/1fa8e4ab56626ff00f97c72637fa2a0cb6318fed. The tikz-cd output isn't yet so good for curved arrows, because shorten doesn't work properly there, but it works well for the original use case (shortening 2-cells).