Can someone explain this gradient in CeTZ?

Hey, I tried putting a gradient on a line (or in this example an arrow) in the CeTZ package - however the gradient only shows in the arrowhead, while the line is split in two with one extreme of the gradient on either side. Can anyone explain to me why this happens?

Here’s my code:


#cetz.canvas(
    {import cetz.draw: *
    line((0, 0, 0), (0, 2, 0), name: "vecj", stroke: 2pt + gradient.linear(..color.map.viridis, angle: 90deg), mark: (end:">"))  
  })

Thanks in advance!

This is a Typst bug. The following code gives the same output:

#curve({
  curve.line((0cm, 2cm))
}, stroke: 2pt + gradient.linear(..color.map.viridis, angle: 90deg))

For reference, I think issue #5799 is tracking the bug

Alright, good to know. Thanks!