-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for edges connecting edges #16
Comments
I do like this idea. The existing functionality to automatically snap to node outlines could easily be extended to edges, too. The main problem is coming up with the best interface for doing this sort of snapping. I used to dislike the idea of giving nodes “names”, à la tikz (see #8), but increasingly I think it might be a good idea. If edges can also be named, then you could do something like #fletcher.diagram(spacing: 2cm, {
let (A, B) = ((0,0), (1,0))
node(A, $cal(A)$)
node(B, $cal(B)$)
edge(A, B, $F$, "->", bend: +35deg, name: "F")
edge(A, B, $G$, "->", bend: -35deg, name: "G")
edge(vertices: ("F", "G"), $alpha$, "=>")
}) However, I still think it's important to have the freedom offered by coordinates, so you can ‘nudge’ edges slightly (e.g., an edge connecting to Interested in your thoughts on the best interface for this. P.S., I haven’t had the time to catch up with issues recently - such is the way of FOSS! |
Personally, I think letting #fletcher.diagram(spacing: 2cm, {
let A = node((0,0), $cal(A)$)
let B = node((1,0), $cal(B)$)
let F = edge(A, B, $F$, "->", bend: +35deg)
let G = edge(A, B, $G$, "->", bend: -35deg)
edge(vertices: (F, G), $alpha$, "=>")
}) For nudging, maybe we could add some offset arguments or directly translating the handle by some amount. The translated handle can be represented as a pair containing the node name and the nudging offset. |
In tikzcd, arrows'
from
andto
could be a name of another arrow, which allows for arrows between arrows. This is somewhat supported intypst-fletcher
, but in a kind of hacky way, as the user still need to figure the exact coordinates of the edgefrom
andto
.Here is an example in the manual that involves a magic number
h
:I'm currently adding typst support for quiver, and of course there is always the option of calculating the coordinates in JS, but I think having
typst-fletcher
supporting edges connecting edges would be a better way to solve this problem.The text was updated successfully, but these errors were encountered: