That doesnât exist yet as a nice recipe, but I have plans for it. A quick mockup without much functionality is this:
@recipe(CurvedArrow) do scene
Theme(
color = :black,
)
end
function Makie.plot!(p::CurvedArrow)
scene = Makie.get_scene(p)
points = lift(p, scene.camera.projectionview, p.model, Makie.transform_func(p),
scene.viewport, p[1], p[2]) do _, _, _, _, p1, p2
return Makie.project.(Ref(scene), (p1, p2))
end
arc = lift(points) do (p1, p2)
len = Makie.norm(p2 - p1)
EllipticalArc(
p1...,
p2...,
len/1.3,
len/1.3,
0,
false,
false,
)
end
path = lift(arc) do arc
BezierPath([
MoveTo(points[][1]),
arc,
])
end
trimarker = BezierPath([MoveTo(0, 0), LineTo(0.5, -1), LineTo(-0.5, -1), ClosePath()])
markerangle = lift(arc) do arc
arc.a2 + pi
end
lines!(p, path, space = :pixel, color = p.color)
scatter!(p, p[2], marker = trimarker, rotation = markerangle, color = p.color)
end
Makie.data_limits(p::CurvedArrow) = Rect3f(Rect2f([p[1][], p[2][]]))
Makie.boundingbox(p::CurvedArrow, space::Symbol = :data) = Makie.apply_transform_and_model(p, Makie.data_limits(p))
f, ax, _ = curvedarrow(Point2f(0, 0), Point2f(1, 1))
curvedarrow!(ax, Point2f(1.1, 1.1), Point2f(1.5, 2))
f
When I make the real one, it will have lots of options, annotation arrows can be pretty tricky to get right