Skip to content

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

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

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().
  • Tests with 1,000,000 points show good performance, although the cached method may be slow on load.

@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
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.

1 participant