Skip to content

[BUG]: scattergl hover freezes with more than 100.000 points all with different x but same y #8036

Description

@martinaquarantelli

Description

In scattergl, when you have more than 100.000 points the scattergl freezes when trying to hover, more informations in the steps to reproduce.

Steps to reproduce

In version 4.0.0
Create a scattergl with 100.000 points with x just the index of the point and y all the same.
you can use this snipper

const n = 100000;

Plotly.newPlot('graph', [{
  type: 'scattergl',
  mode: 'markers',
  x0: 0,
  dx: 1,
  y: Array(n).fill(0)
}]);

The default hovermode will be ok, no need to change it.
Try hovering on the point: the app freezes immediately.
Staying in the horizontal line of the points will make it look a little slow but normal, but when you exit from the line it freezes again.
Try removing one point (99.999 points): the freeze is gone.

Notes

Probably related to #6792 and #5790 but can't confirm if it's completely the same, this is more specific.
It is probably due to to the collapsation of the algorithm that comes in in a scattergl when there are TOO_MANY_POINTS (exactly 100.000).

Activity

  1. Lexachoc commented on Sep 11, 2026

    @Lexachoc
    Contributor

    It seems that #7998 will solve this issue (at least for the biggest problem). The problem is that with >=100K data points, hovering will trigger a search through all points because spikedistance is set to infinity.

    A workaround before the draft is merged is simply to set spikedistance: 0, although it is still a little bit laggy since all data points are in one line.

  2. camdecoster commented on Sep 14, 2026

    @camdecoster
    Contributor

    Thanks for the report! There is definitely some room for optimization in this area and it sounds like you hit one of those areas. Emily will get #7998 ready for review and we'll see if your issue is addressed by that.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething brokensize: 3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions