typst-fletcher icon indicating copy to clipboard operation
typst-fletcher copied to clipboard

Feature Request: Anchor destinations for edges connecting nodes.

Open kdog3682 opened this issue 2 years ago • 1 comments

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]) 

})

kdog3682 avatar Apr 03 '24 15:04 kdog3682

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.

Jollywatt avatar Apr 04 '24 00:04 Jollywatt