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

Feature Request: Anchor destinations for edges connecting nodes. #21

Open
kdog3682 opened this issue Apr 3, 2024 · 1 comment
Open

Comments

@kdog3682
Copy link

kdog3682 commented Apr 3, 2024

It would be really nice to have a way to specify where (with regard to a node) an arrow should point at.

Sample Code:

#diagram({
   node((0,0), [hi])
   edge(from: "north", to: "south-west") // coming from the north of the previous node and pointing to the southwest of the destination node.
   node((3, 3), [hi]) 

})
@Jollywatt
Copy link
Owner

Does something like the following do what you mean?

#import "@preview/fletcher:0.4.3": diagram, node, edge

#diagram({
  node((0,0), [start])
  edge("n,e,sssss,e,ne") // line goes [n]orth from previous node, then east, south 5 units, east, then north-east into the next node
  node((3,3), [end])
})

You have to describe the exact path yourself, though.

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

No branches or pull requests

2 participants