-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Fixes 4641 & 4645 #4647
Fixes 4641 & 4645 #4647
Conversation
The use of Swift Algorithms partitioningIndex with exact matching clause == can provide incorrect values. It has been modfied to use a >= clause as well followed by a check for an exact match from that index. This should maintain the intended behaviours and I have added a It has been modfied to use a >= clause as well followed by a check for an exact match from that index. This should maintain the intended behaviours and I have added a fix for fetching the closest X value index when the value falls between 2 indexs and uses .closest for rounding method.
Fix 4647 bug when no matching paritiningIndex found (occurs when clicking to right of last plotted point)
This edge case relates to checking the closest by checking the previous index, needed a StartIndex check.
@danielgindi I'm surprised at the low attention this has gotten as I'd have thought this feature was pretty core to the libraries example usage. Is it just a time issue or does this PR need to be of better quality in some way? |
I can confirm this PR fixes the issues I've been encountering with markers in my line charts. It would be great to get this merged into the main branch and get an updated release out. @Lee-Waire-Health thanks for developing the fix. |
Also confirming that this fixes issues with highlighting values that I've been seeing, thanks for the PR @Lee-Waire-Health, @danielgindi would love for this to be incorporated into the main repo. |
Agree @bohemima, it would be great to get this incorporated @danielgindi. Thanks for your work @Lee-Waire-Health! |
One issue here is that the partitioningIndex fails when xValue to search is larger than any $0.x, it returns indexEnd. Consequently the guard statement fails and the function returns empty []. This the .closest strategy does not return the nearest entry. The issue arrises when the data line should get drawn where the highestVisibleX value is larger than any entry.x. |
@Lee-Waire-Health Thanks for the fix, I am temporarily switching to your branch! |
@Lee-Waire-Health @GinesSanchez-TopTracer could you validate that #4721 fixes the problem you were having here |
The use of Swift Algorithms partitioningIndex with exact matching clause == can provide incorrect values.
It has been modfied to use a >= clause as well followed by a check for an exact match from that index.
This should maintain the intended behaviours and I have added a
It has been modfied to use a >= clause as well followed by a check for an exact match from that index.
This should maintain the intended behaviours and I have added a fix for fetching the closest X value index when the value falls between 2 indexs and uses .closest for rounding method.
Issue Link 🔗
4641
Goals ⚽
Implementation Details 🚧
Testing Details 🔍
ChartDataTests -> testEntriesForXValue