Closed TakodaS closed 1 month ago
Try using rotate(reflow: true)
?
Ah it was right there in the typst documentation! Much appreciated! It is getting there but still doesn't work properly for the 45deg label
#import "@preview/fletcher:0.4.3" as fletcher: diagram, node, edge
#set page(width: 270pt, height: 320pt)
#diagram(
debug: 3, node((0, 0), "A"), node((0, 1), "B"), edge(
(-1, 0), (-1, 1), "->", rotate(-90deg, reflow: true)[Some complicated flow], label-side: right,
), node((0, 3), "C"), node((2, 5), "D"), edge(
(0, 3), (2, 5), "->", rotate(45deg, reflow: true)[Some complicated flow], label-side: left,
),
)
I think this behavior should be by default in fletcher, maybe eventually leading to "text along path" functionality like in latex. What do you think?
Yeah, that looks wrong - and worse I can't seem to fix it by playing around. Since this is so hard, automatic rotation of labels along (straight) edges would be a good feature to add.
This has been added in 7ba5655!
Unless I am mistaken, it is currently not possible to have edge labels follow the edge they are attached to. Unfortunately, using the builtin
rotate
function causesdiagram
to become very confused leading to spacing issues.