GraphMakie includes pre-built interaction types for highlighting and dragging nodes and edges. To use them, you must register them to the axis (ax) using register_interaction!. It is often necessary to deregister_interaction!(ax, :rectanglezoom) first if you want to avoid conflicts with default Makie interactions.
Available predefined interactions:
NodeHoverHighlight(p): Highlights nodes on hover.EdgeHoverHighlight(p): Highlights edges on hover.NodeDrag(p): Enables dragging nodes.EdgeDrag(p): Enables dragging edges.
using GLMakie
using GraphMakie
using Graphs
g = wheel_graph(10)
f, ax, p = graphplot(g, edge_width=[3 for i in 1:ne(g)],
node_size=[10 for i in 1:nv(g)])
deregister_interaction!(ax, :rectanglezoom)
register_interaction!(ax, :nhover, NodeHoverHighlight(p))
register_interaction!(ax, :ehover, EdgeHoverHighlight(p))
register_interaction!(ax, :ndrag, NodeDrag(p))
register_interaction!(ax, :edrag, EdgeDrag(p))