VisHooks#
- class braincell.vis.VisHooks(on_pick=None, on_hover=None, on_leave=None)[source]#
Bundle of interactive callbacks understood by the vis backends.
Hooks are optional; passing
VisHooks()(the default) wires nothing. When any callback is set the backend takes an interactive path — for matplotlib that means enablingpick_eventand/ormotion_notify_eventon the figure canvas; for PyVista it means callingpyvista.Plotter.enable_point_picking().- Parameters:
on_pick (
Callable[[PickInfo],None] |None) – Called with aPickInfowhenever the user clicks a branch. Use this for “click to inspect” tooling.on_hover (
Callable[[PickInfo],None] |None) – Called with aPickInfowhile the mouse hovers over a branch. Only delivered by the matplotlib backend at present; PyVista does not currently expose a hover event.on_leave (
Callable[[],None] |None) – Called with no arguments when the mouse moves off a branch after having hovered over it. Matplotlib only.
Notes
Callbacks are invoked synchronously from the event loop. Keep them cheap; heavy work belongs in a
QueueTimeror async task.