def METHOD_NAME(self, data):
    from jdaviz.configs.imviz.helper import get_top_layer_index
    event = data['event']
    if event == 'dragstart':
        # When blinked, first layer might not be top layer
        # TODO: could optimize this further by listening for changes to the layers
        # and viewer size rather than having to set this on the dragstart event
        i_top = get_top_layer_index(self.viewer)
        state = self.viewer.layers[i_top].state
        self._layer_state = state
        self._max_x = self.viewer.shape[1]
        self._max_y = self.viewer.shape[0]
    elif event == 'dragmove':
        self._dragevent(data)
    elif event == 'dblclick':
        # Restore defaults that are applied on load
        i_top = get_top_layer_index(self.viewer)
        state = self.viewer.layers[i_top].state
        with delay_callback(state, 'bias', 'contrast'):
            state.bias = 0.5
            state.contrast = 1