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

Ouverte
#8,134 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
58/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
javascript

Piste de recherche

Start by comparing the hover path in src/traces/scattergl/hover.js with the threshold and point-cluster tree behavior in src/traces/scattergl/constants.ts; reproduce the lag with the provided 100,000 point example and compare it with 99,999 points. Determine why the .range() call is slow with infinite or wide bounds, then verify hover remains responsive at and above the threshold.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug P3 size: 3
Description

With 100,000 or more points, hovering over a scattergl trace is much slower than with 99,999 points.

Steps to reproduce
  • Open Plotly devtools and paste the following into the browser devtools console:
let n = 100000;

Plotly.newPlot('graph', [{
  type: 'scattergl',
  mode: 'markers',
  x0: 0,
  dx: 1,
  y: Array(n).fill(0)
}]);
  • Hover over individual points and note the lag
  • Change n to 99999 and note that hover is fast
Notes
  • At TOO_MANY_POINTS (src/traces/scattergl/constants.ts), scattergl switches from a plain array to the point-cluster tree
  • The slow call is .range() in src/traces/scattergl/hover.js
  • It's very slow with infinite bounds; it also seems slower than a plain array scan when the bounds cover a large share of the points
  • Either hover.js calls .range() in a non-optimal way, or plotly/point-cluster has a performance bug
  • #8052 stops the plot from freezing, but hover is still laggy
  • Also related to #8036
Langage dominant
JavaScript
Étoiles
18.4k
Forks
2.1k
Merge moyen
1 j 5 h
PR mergées (30 j)
12

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de plotly/plotly.js

Toutes les issues de plotly/plotly.js

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.