skokenes / D3-Lasso-Plugin

A lasso selection tool for D3
BSD 3-Clause "New" or "Revised" License
79 stars 25 forks source link

Lasso not selecting all points in selection #11

Closed projecttiles closed 8 years ago

projecttiles commented 8 years ago

Hey skokenes,

First off, I wanted to say that this is a great widget. As someone with very little d3 knowledge, this gave me a nice entry point.

I did notice, however, that not every lasso selection included all of the points in the selection. It might be a problem specific to non-convex selection areas, but I'm not 100% sure.

Thanks,

lasso_sel_bug

ghost commented 8 years ago

+1 Same here

skokenes commented 8 years ago

Can you show some examples, maybe via animated GIF, of the shape that you are drawing to produce these results? That way I can reproduce. Thanks!

On Thu, May 12, 2016 at 1:25 PM, Baz notifications@github.com wrote:

+1 Same here

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/skokenes/D3-Lasso-Plugin/issues/11#issuecomment-218826912

ghost commented 8 years ago

Here's a screenshot of one example:

Example

And a video of another example. You can see it takes a couple of attempts to get one that fails, but even the earlier ones flicker at the end.

Video

ghost commented 8 years ago

Here's another video that shows something interesting and should be easily reproduce-able.

It shows that each of the four data points flickers (becomes unselected and selected) when the y coordinate of the cursor is exactly on the y position of the data point. It might have something to do with the reported issue.

Video

projecttiles commented 8 years ago

Thanks Baz! I was going to show similar example, but the computer I'm on right now is on its last legs (slows easily during screengrabs).

I can't find any issue that's directly attributable in your code, but it's likely within the lasso draw method.

On Fri, May 13, 2016 at 6:18 AM, Baz notifications@github.com wrote:

Here's another video that shows something interesting and should be easily reproduce-able.

It shows that each of the four data points flickers (becomes unselected and selected) when the y coordinate of the cursor is exactly on the y position of the data point.

[image: Video] https://www.youtube.com/watch?v=STQ8AzyRUcg

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/skokenes/D3-Lasso-Plugin/issues/11#issuecomment-219005976

projecttiles commented 8 years ago

Hey skokenes, has there been any update to this? How can we help fix the issue with you?

Thanks,

-PT

projecttiles commented 8 years ago

I think this block: if(d.lassoPoint.cy === cur_pos_obj.y && d.lassoPoint.cy != prior_pos_obj.y) { last_known_point = { x: prior_pos_obj.x, y: prior_pos_obj.y }; on lines 186-194 in lasso.js is the root of the problem. WACMemphis mentioned a flickering whenever the y-value of a point was crossed causing deselection.

I hope this helps! I wish I knew js better myself so that I could be of more help.

-PT

ghost commented 8 years ago

@skokenes Any update on this? I've tried to fix it myself, but can't seem to be able to.

projecttiles commented 8 years ago

He opened up a new empty repo because he wanted to add d3 v4 support. However, I have no clue what to expect from that or when.

This is so close to ideal. I've been spending all of my time in Python, so web dev and js are still quite foreign to me.

skokenes commented 8 years ago

Hi, I've migrated the library to v4 with some better code under the hood. Can you please test out that version?

There has been little interest from the community in helping maintain the d3 v3 version of this plugin, so I may close this repo and focus sole on the new repo going forward

https://github.com/skokenes/d3-lasso