Since bandwidth is a featured adjustable parameter in this notebook, would it make sense to have the number of thresholds (currently set to 40 in this cell) depend on the bandwidth? Perhaps something like numThresholds = dataRange / bandwidth, where dataRange = d3.max(data) - d3.min(data)?
My intuition is that when plotting in the wild, the situation could be reversed: one could fix the number of thresholds at 40 and then let bandwidth = dataRange / numThresholds.