'Assign a callback to hover events propagated
by hovering over points in the Plotly graph.
Args:
callback (function): Callback function this is called
on hover events with the signature:
callback(widget, hover_obj) -> None
Args:
widget (GraphWidget): The current instance
of the graph widget that this callback is assigned to.
hover_obj (dict): a nested dict that describes
which point(s) was hovered over.
hover_obj example:
\'curveNumber\': 1,
\'pointNumber\': 2,
\'x\': 4,
\'y\': 14
remove (bool, optional): If False, attach the callback.
If True, remove the callback. Defaults to False.
Returns:
None
Example:
from IPython.display import display
def message_handler(widget, hover_msg):
display(widget._graph_url)
display(hover_msg)
g = GraphWidget(\'https://plot.ly/~chris/3375\')
display(g)
g.on_hover(message_handler)'

def on_hover(self, callback, remove=False):

    self._handle_registration('hover', callback, remove)
