-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Milestone
Description
Hi,
It seems that names passed as first and second argument to draw-edge have a "g" in front. For example, in the following, I would expect there to be a solid line from a to b and a dashed line from a to c:
#import "@preview/cetz:0.4.2"
#cetz.canvas({
import cetz.tree
import cetz.draw: *
tree.tree(
draw-edge: (start, end, ..) => {
if end == "0-0" {
line(start, end)
} else {
line(start, end, stroke: (dash: "loosely-dotted"))
}
},
([a], [b], [c])
)
})
The one with the g seems to be the group-name, though it is not clear to me from the documentation what that means.
This does work:
draw-edge: (_, _, parent, child) => {
if child.name == "0-0" {
line(parent.group-name, child.group-name)
} else {
line(parent.group-name, child.group-name, stroke: (dash: "loosely-dotted"))
}
Is this the intended behavior/usage?
Metadata
Metadata
Assignees
Labels
No labels