EventDrops
EventDrops copied to clipboard
Is there a way to restrict the range you can scroll to.
Is there a way to restrict the range you can scroll to. With the end and start set and with a maxZoom set you can still scroll indefinitely into the future and past.
Have a go at providing values for minScale
and maxScale
. The defaults for these are 0
and Infinity
, setting them will restrict the scroll range range.
Thanks for this, however minScale and maxScale only seem to control zoom in and out but not the date range. e.g. I can scale down to days and scale up to years, however by moving left and right a user can potentially go back to the 10BC or forward to the year 4000.
Here is a link for inspiration: http://bl.ocks.org/shawnbot/6518285
If anyone is looking at this later on, you have to set .extent() and .translateExtent() passing in the constraint.