-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to include y distance for nearest touched spot #891
Conversation
I will check it soon. |
Just to be clear, this PR and #892 to are independent of each other, although it might make sense to use them together in many cases. |
@joeldomke I think it will fix #892 too. Let me explain my approach: I mean instead of having LineTouchResponse(List<LineBarSpot> lineBarSpots) Have something like this: LineTouchResponse(List<LineBarSpot> allSpotsInY, LineBarSpot nearestTouchedSpot) Now you can do whatever you want with these two values. Let me know what do you think. |
Initially I liked your approach since it fixes #892 at the same time. But it actually misses the case mentioned in #892 where two points of two lines have the same x and y coordinate, (which is handled by option 2 and 3 in this ticket). Adding the distance property mentioned in option 2 and 3 in #892 might also be useful for the case where we only consider the x distance. If you don't want to add anything to LineTouchResponse(List<LineBarSpot> lineBarSpots, List<LineBarSpot> lineBarSpotsEuclidian) were |
There is a |
Lowering the threshold does not really fix the problem. After lowering it (which I maybe don't want because I want certain user interaction) I could just move the two points close together and would again face the same issue. |
I switched to a new approach where the user can set a distance function. Also I added the distance to |
Let me know when you did finish your coding. I will review it all at once. |
Any news on this? |
Should be finished now |
Codecov Report
@@ Coverage Diff @@
## dev #891 +/- ##
==========================================
+ Coverage 80.65% 80.87% +0.21%
==========================================
Files 32 32
Lines 2973 3007 +34
==========================================
+ Hits 2398 2432 +34
Misses 575 575
Continue to review full report at Codecov.
|
I wrote my last comments. Also, you must rebase this branch with our |
I merged dev into my branch, did this solve the conflicts? |
No, it doesn't solve the problem. |
2abad75
to
0b528c9
Compare
I squashed them into one and rebased with the dev branch |
I know it took a long time. Thanks for being patient. |
And about the CHANGELOG.md, thank you for adding BREAKING change. |
Any update? |
Yes, it's hopefully done now. And also thank your for your patience. This is my first PR and there were a lot of things I missed at first, but I enjoyed it. |
Thank you @joeldomke It will be great if you modify (or add) a chart to showcase this feature in your next PR. |
Instead of only considering the distance on the x axis when checking for the closest spot, this feature allows to choose the closest spot based on Euclidean distance
TODO:
Fixes #716, #261