sangltdn / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Selection plugin #217

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was considering doing some changes to the selection code (to make
selections resizable and movable). So to get an idea of what would be
involved, I started by pulling the selection code into a plug-in. Here is
the patch and the plugin, if interested.

- the code to prevent text selection is left in the main code, as it seemed
to be generally useful.
- the extractRange code is kind of inlined into the setSelection function
in the plug-in. Either the backwards compatibility code should be removed
or extractRange should be made public and used instead .
- the parseColor function is made public as it seemed it would be useful in
other plug-ins as well (e.g. the crosshair plug-in also have color settings).

Original issue reported on code.google.com by anders...@gmail.com on 31 Aug 2009 at 9:22

Attachments:

GoogleCodeExporter commented 9 years ago
Interesting, thanks! I was planning to do this myself at some point. I'll have 
a look
at your patch soon, just need to get a few things off my back first.

Original comment by olau%iol...@gtempaccount.com on 7 Sep 2009 at 12:08

GoogleCodeExporter commented 9 years ago
Thanks for the feedback. I have gotten to know the selection code a bit better 
as I
added the dragging and resizing of selections. It is perhaps a bit of a hack, 
but I
attached this code as a diff against the current svn version. Let me know if 
you want
me to make changes to any of the patches.

Original comment by anders...@gmail.com on 11 Sep 2009 at 8:58

Attachments:

GoogleCodeExporter commented 9 years ago
Hi! I've merged your plugin patch. I ended up moving all the code to the 
plugin. I
think we can simplify it by sharing some code with the navigation plugin which 
is
using another native jQuery plugin, but that code is unfortunately not a 100% 
match
for what Flot needs. So we should probably write a small drag handler library as
replacement and share it between the two plugins. With that in mind, I didn't 
want to
leave the text prevention selection behind in core Flot.

I fixed the color problem by moving the helpers to a separate jQuery plugin 
which
I'll release separately soon. For now I'm including it inline in the Flot 
source (and
hosting the code here too).

So there. Thanks! :)

I had a quick look at your selection drag patch, but if you think it's a hack, 
I'd
rather not preoccupy myself with it right now. My main focus is getting all this
released tomorrow as Flot 0.6.

Original comment by olau%iol...@gtempaccount.com on 22 Oct 2009 at 10:35