Skip to content

Fix: Performance for greater than 100k points on hover in scattergl - #8198

Draft
hobob0t wants to merge 3 commits into
plotly:mainfrom
hobob0t:scattergl_hover_slow
Draft

hobob0t wants to merge 3 commits into
plotly:mainfrom
hobob0t:scattergl_hover_slow

Conversation

@hobob0t

@hobob0t hobob0t commented Nov 25, 2026 •

Copy link
Copy Markdown

Bug

  • hoverlabels in scattergl can slow down responsiveness when n points>99,999 as in [BUG]: scattergl hover is slow above 100k points #8134
  • the range() function traverses the tree and results in a large array of candidate points. Infinite bounds can also produce NaN rectangle points

Fix

  • A cached nearest-neighbor index for large traces. The search skips groups that cannot contain the closest point and reuses the index across pan and zoom. Period-aligned traces and axes with range breaks retain the existing search path. Infinite-bound fallback queries scan point IDs instead of passing infinite bounds to .range().
  • Edit: Closes [BUG]: scattergl hover is slow above 100k points #8134 sorry I forgot the proper keywords earlier. I also asked for ready-for-pr in the linked issue. Apologies for doing things out of order

@hobob0t hobob0t changed the title cached nearest-neighbor index for traces with at least TOO_MANY_POINT… Fix: Performance for greater than 100k points on hover in scattergl Nov 26, 2026
@hobob0t

hobob0t commented Dec 4, 2026

Copy link
Copy Markdown
Author

Changing to draft PR since I did things out of order. I am waiting on a ready-for-pr tag on the linked issue.

@hobob0t
hobob0t marked this pull request as draft December 4, 2026 19:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: scattergl hover is slow above 100k points

1 participant