Navigation plugin: unify panRange & zoomRange restriction handling #48

wants to merge 12 commits into


None yet

3 participants

risicle commented Jun 19, 2012


This is supposed to supersede my pull requests 44 & 45, which I'll close.

I've merged those two branches into something that uses a single setMinMax method to sanitize & set the min/max of an axis.

I've also added a setRanges & getRanges set of methods I needed that are supposed to mirror the behaviour of setSelection et al in the selection plugin.

On top of that I've updated the included jquery.event.drag for better jquery 1.7 support and partial touch event support.

You probably won't want all these changes, so I'm afraid you might just have to do some cherrypicking of patches, as I've already got more than enough branches to worry about :)

risicle added some commits Jun 5, 2012
@risicle risicle navigate plugin: enforce any panRange restrictions of an axis when zo…
…oming out
@risicle risicle navigate plugin: cope better with potential complications when using …
…nonlinear transforms and restricting against panRanges when zooming out
@risicle risicle navigate plugin: don't just give up if new zoom is outside the zoomRa…
…nge - set to the minimum/maximum range where possible. not perfect, particularly with respect to the centering of these final partial zoom steps.
@risicle risicle Merge branch 'navzoompartial'
@risicle risicle navigate plugin: unify restriction checking & sanitizing to a setMinM…
…ax function

called by both pan & zoom functions to check all restrictions are obeyed
@risicle risicle navigate plugin: add setRanges & getRanges methods
intended to behave like other plugins (e.g. selection) that get & set
their bounds with range objects
@risicle risicle navigate plugin: update jquery.event.drag for jquery1.7 & partial tou…
…ch support
@dnschnur dnschnur was assigned Jun 20, 2012
@risicle risicle navigate plugin: call triggerRedrawOverlay on bounds changes
I suspect most overlay content is position-related to the underlying
plot, so we'll want to redraw the overlay in the correct position
after changing the bounds. "live panning" can look a bit juddery at
the moment due to the different delay/draw coalescing behaviour of
plot & overlay

Thanks for submitting this! I've run into the same problem myself; just didn't have time to fix it. I'm almost through the pull request backlog, so I'll be reaching yours shortly.

risicle commented Jun 23, 2012

I'm using this (along with a couple of other plugins I haven't submitted requests for yet) to implement one of those pan 'n scan overview-style plots (whatever people call them).

As in - the lower box can be dragged for panning and its edges can be dragged to move them.

This uses another plugin I wrote ("draggableselection") - though now I'm thinking maybe I shouldn't be sending pull requests till this stuff has got through the testing phase of my development cycle.

This was referenced Sep 28, 2012

Moving this to the 0.9 milestone; we'll focus on plugins, so this is a good fit.


See #1431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment