Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#8,082 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
JavaScript
Estrellas
18.3k
Forks
2k
Merge medio
1 d 19 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de plotly/plotly.js

Todos los issues de plotly/plotly.js

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.