Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Snap to ticks mode for the selection #129

Open
dnschnur opened this Issue · 5 comments

1 participant

@dnschnur
Owner

Original author: matt.kn...@gmail.com (July 22, 2008 17:23:24)

This is an enhancement rather than a issue. The attached code is simply proof of concept and
should be considered incomplete.

Selecting ranges (selection-mode-x) is great but I wanted to make it easier to select the entire
region between ticks. I wanted when I click the mouse and move for the current region to be
selected and then as I cross over each tick the next region is selected in whole, rather than pixel
by pixel.

The patch as I said is little more than a proof, it doesn't work correctly going from right to left.
There's a variable glob that's simply a placeholder, ideally this would be replaced by some
configuration. I figured it was best to simply do a proof of concept to illustrate what I wanted,
then as you guys have time/interest you can come up with a clean/proper implementation.

Attached is an example screenshot and a patch.

Original issue: http://code.google.com/p/flot/issues/detail?id=50

@dnschnur
Owner

From ryan.fun...@gmail.com on August 01, 2008 20:42:48
This is a good idea, I think, but the problem is that it's a lot of processing going
on in the background to always look-ahead to the next point. Also, as you no-doubt
noticed, going the other way adds even more processing to determine which direction
you're selecting, etc.

Interesting, though. I'll keep my eye out for efficient ways to implement this in my
flot fork (ryanfunduk.com/flot-on-github).

@dnschnur
Owner

From ryan.fun...@gmail.com on August 18, 2008 16:02:26
I've got it working in my forked version now. I realized we're only talking about
snapping to TICKS not datapoints so it really wasn't a processing problem. There is a
wierd issue that only sometimes shows up where the selection loses the tick you
started on... Working on it :)

@dnschnur
Owner

From olau%iol...@gtempaccount.com on September 18, 2008 09:56:35
Sounds simple enough although at little complication is that API-wise we need to
take dual-axis support into account. Maybe snapToTicks in selection which could be
an array of "x" or "y" or "x2" or "y2". I'd be happy to review a patch.

@dnschnur
Owner

From li...@rockbottomfurniture.net on July 07, 2009 22:29:59
Does this now work for dual-axis?

@dnschnur
Owner

From olau%iol...@gtempaccount.com on October 27, 2009 13:16:32
The selection is now a plugin. So this should be easy to hack in, if someone's
interested in making patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.