Implement the callback of the threshold-slider