Repository navigation
Conversation
Apply the index scale's pixel direction when choosing the binary-search bounds, so overlapping points remain selectable on reversed x and ordinary vertical y index scales. Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Compare optimized point interaction with direct hit testing at three positions on x/y index scales, with reverse enabled and disabled. Confirm sorted data and shared options exercise ranged binary search. Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
This was referenced Oct 25, 2026
Author
|
Could you review this reversed-index interaction fix when you have time? The separate final-animation-position lookup (#12359), epoch-zero time bounds (#12360), and logarithmic zero-state reset (#12361) fixes are also awaiting review. Each description records its own regression results and validation limits; the hosted CI and Compressed Size runs still require maintainer approval. Grouping this follow-up here rather than repeating it on each PR. Please let me know if changes are needed. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The shared-options branch in interaction's binary search searches
value - rangefor the start index andvalue + rangefor the end index. Those bounds are in the opposite order when the index scale's pixel coordinates descend, such as a reversed x scale or an ordinary vertical y index scale. As a result, point interaction can return no elements even when several points overlap the event.Apply the pixel direction to the range before choosing the bounds. This keeps the existing binary-search optimization and avoids changing non-intersecting interaction or datasets without shared options.
Tests
Added four cases for x/y index axes with
reverseenabled and disabled. Each compares point interaction with directinRangehit testing at three positions. The tests assert sorted data and shared options so they exercise the optimized branch.pnpm lint, including JavaScript/Markdown lint, build/declaration generation and type tests, passes with existing warnings.A rendered comparison using the unchanged and patched builds confirms the example returns 0 of 3 overlapping points before the fix and all 3 after it.