Skip to content
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

[charts] Improve zoomed highlight behaviour #13868

Merged
merged 14 commits into from
Jul 18, 2024
Merged
Prev Previous commit
Update packages/x-charts/src/ChartsVoronoiHandler/ChartsVoronoiHandle…
…r.tsx

Co-authored-by: Alexandre Fauquette <[email protected]>
Signed-off-by: Jose C Quintas Jr <[email protected]>
JCQuintas and alexfauquette authored Jul 18, 2024

Verified

This commit was signed with the committer’s verified signature.
gnxlxnxx Roman Kretschmer
commit e5306c86c2652aa31d0638218a08077d6e7c026b
Original file line number Diff line number Diff line change
@@ -76,6 +76,9 @@ function ChartsVoronoiHandler(props: ChartsVoronoiHandlerProps) {
const pointY = getYPosition(y);

if (!drawingArea.isPointInside({ x: pointX, y: pointY })) {
// If the point is not displayed we move them to a trash coordinate.
// This avoids managing index mapping before/after filtering.
// The trash point is far enough such that any point in the drawing area will be closer to the mouse than the trash coordinate.
return [-drawingArea.width, -drawingArea.height];
}