Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG]: `scattergl` and `splom` hover ignores marker size for overlapping points

Aperta
#8,082 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Reproduce the overlapping-marker example in the browser devtools, then compare scatter/hover.js with the scattergl and splom hover paths. Read the marker sizes computed in scattergl/convert.js and trace how the spatial-tree search uses hoverdistance. Done means WebGL hover ranking matches scatter for marker size and x-hovermode without unintended changes elsewhere.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug P3 size: 3
Description

If markers of different sizes overlap, scatter and scattergl show different hover labels. scatter includes the marker radius in the hover distance, and a smaller marker wins while the pointer is near its center (src/traces/scatter/hover.js). scattergl and splom measure only the distance to the marker center, so the marker drawn on top always wins. scatterpolargl inherits this through scattergl.

scattergl also uses a plain |dx| in x hovermode, but scatter changes the shape of dx inside the marker radius. That difference can rank close points differently.

This is a follow-up to #8077, which fixed ties between equal distances.

Steps to reproduce
  • Open Plotly devtools
  • Run this snippet in the browser devtools
Plotly.newPlot(gd, {
    data: [
        { type: 'scatter', name: 'A', mode: 'markers', marker: { size: 6 }, x: [1], y: [0] },
        { type: 'scatter', name: 'B', mode: 'markers', marker: { size: 20 }, x: [1], y: [0] }
    ],
    layout: { hovermode: 'closest' }
});
  • Hover the center of the shared point
  • Note that the label shows A
  • Change both traces to type: 'scattergl' and hover again
  • Note that the label shows B
Notes
  • A fix probably means sharing the scoring functions in scatter/hover.js with scattergl and splom
  • Each marker's radius can be taken from the sizes that scattergl/convert.js already computes
  • Large traces search a spatial tree within hoverdistance of the pointer, so the search box also has to grow by the largest marker radius
  • This would changed hover results for every WebGL plot with markers of different sizes, so we need to be careful about the blast radius
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
1g 19h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di plotly/plotly.js

Tutte le issue di plotly/plotly.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.