Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loops #18

Closed
varkor opened this issue Dec 11, 2017 · 9 comments · Fixed by #35
Closed

Loops #18

varkor opened this issue Dec 11, 2017 · 9 comments · Fixed by #35

Comments

@varkor
Copy link
Contributor

varkor commented Dec 11, 2017

One often want arrows from an object to itself (achieved with the tikzcd loop parameter), but it's only possible to draw arrows between different grid cells at the moment.

@yishn
Copy link
Owner

yishn commented Dec 11, 2017

Can you post a simple LaTeX code snippet for loops? Do you have an idea how to let users create loops in tikzcd-editor? Currently, creating an arrow is only possible by dragging from one cell to another.

@varkor
Copy link
Contributor Author

varkor commented Dec 11, 2017

\begin{tikzcd}
A \arrow[loop]
\end{tikzcd}

Produces the following diagram:
image
As for the interface, I think that not adding arrows when you haven't dragged between two cells is useful (for cancelling arrow placement), so perhaps a button that appears (similar to the "move object" handle) when arrow placement is selected, that adds a loop, would be simplest. The loop could then be manipulated with the existing arrow toolbar. It would be nice to also specify which side of the object the loop is drawn on, too.

@yishn
Copy link
Owner

yishn commented Dec 11, 2017

Thank you for your input! Just out of curiosity's sake, can you rotate the loop in certain directions? For example, so that the "bump" points to the left?

@varkor
Copy link
Contributor Author

varkor commented Dec 11, 2017

\arrow[loop left] (or above/below/right) allows you to specify the direction, although specifying the direction a little more explicitly in the code output with out=angle and in=angle may result in slightly prettier loops. (I think these arguments come directly from TikZ, rather than tikz-cd).

@technicalguy
Copy link

I reckon the UI for loops and pullbacks (see issue #11) could be similar - a button and a way to change the position (e.g. a handle that can be dragged to rotate it to each of 4 directions [or more]).

@ericelliott
Copy link

This is a great suggestion. Identity arrows are very commonly needed to describe basic category theory principles and identity morphisms for axioms.

@ericelliott
Copy link

There is a $200 bounty open for the developer who adds this feature.

@technicalguy
Copy link

Well I'll see if I can take a look at implementing this in the next week or two...

@varkor varkor mentioned this issue Dec 17, 2018
@varkor
Copy link
Contributor Author

varkor commented Dec 17, 2018

As there hadn't been much movement on this issue in a while, I went ahead and implemented the feature (pull request at #35). I think the interface works quite well and it should definitely be sufficient for most of the use-cases of loops.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants