'Assign a callback to zoom events propagated
by zooming in regions in the Plotly graph.
Args:
callback (function): Callback function this is called
on zoom events with the signature:
callback(widget, ranges) -> None
Args:
widget (GraphWidget): The current instance
of the graph widget that this callback is assigned to.
ranges (dict): A description of the
region that was zoomed into.
ranges example:
\'x\': [1.8399058038561549, 2.16443359662],
\'y\': [4.640902872777017, 7.855677154582]
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, ranges):
display(widget._graph_url)
display(ranges)
g = GraphWidget(\'https://plot.ly/~chris/3375\')
display(g)
g.on_zoom(message_handler)'

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

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