Yes, indeed I tried a bit and converge to the same idea. I used extrude only for the end nodes. And just declare a second node for the label and put it just below. It’s just a bit weird to declare a second node below to just put the label to avoid the issue. Also, extrude is a bit confusing to work with since the edge collides with it.
My code for the moment is this
diagram(
node-stroke: 0.8pt,
{
let diamond(node, extrude) = fletcher.shapes.diamond(
node,
extrude,
fit: 0.5,
)
node(
(0, 1),
shape: circle,
fill: black,
stroke: red,
radius: 2.5mm,
)
let poll(..args) = {
edge(..args, label: "poll()", marks: "-|>")
}
node((0, 1.4), "Start", stroke: none)
poll(
(0, 1),
(0, 0),
(1, 0),
label-pos: 20%,
)
node((1, 0), "A file \nready?", shape: diamond)
let light_red = red.desaturate(70%)
let mid_red = red.darken(30%)
edge((1, 0), (2, 0), marks: "-|>", label: "yes")
node(
(2, 0),
"",
width: 5mm,
height: 5mm,
shape: diamond,
fill: light_red,
stroke: mid_red,
)
edge((2, 0), (3, 0), marks: "-|>")
node((3, 0), "B file \nready?", shape: diamond)
node(
(4, 1),
shape: circle,
fill: black,
stroke: red,
radius: 2.5mm,
extrude: (0, 3),
)
node((4, 1.4), "End", stroke: none)
edge((3, 0), (4, 0), (4, 1), marks: "-|>")
},
),
And the rendering is that.