[BUG]: Some event payload types don't match what's actually emitted

Aperta
#8,147 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@darshpatel1052 ci sta già lavorando.

Dal 3/11/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, typescript

Direzione di ricerca

Start with src/types/core/events.d.ts and compare the event interfaces with the emitted payloads listed in the issue, including the parcoords hover and unhover events. Check related tests or event definitions for these cases; done means the types represent the listed payload shapes and optional fields accurately.

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

Descrizione

bug P2 plotly-internal size: 1
Description

Some event types in src/types/core/events.d.ts do not match the payload that plotly.js emits.

Steps to reproduce
  • Register gd.on('plotly_beforeplot', (event) => event.data) and call Plotly.newPlot. The code compiles, but event.data is undefined.
  • Register gd.on('plotly_selected', (event) => event.points) and clear a selection. The code compiles, but event is undefined.
  • Register gd.on('plotly_click', (event) => event.event.clientX) on a scatter3d plot. The code compiles, but event.event is undefined.
Notes
  • This is a follow-up to #8145
  • Required changes:
    • plotly_beforeplot: the payload is the tuple [data, layout, config], but BeforePlotEvent is an object.
    • plotly_selected: the payload is undefined when a selection is cleared, but the callback type does not allow it.
    • PlotMouseEvent.event: gl3d traces emit no event, but the field is required.
    • PlotHoverEvent.xvals and yvals: only cartesian traces set them, but both fields are required.
    • LegendClickEvent.node: the value is an SVG element, but the type is PlotlyHTMLElement.
    • Missing optional fields: xaxes, yaxes, xvals and yvals on click events, selections on plotly_selected, group and label on legend clicks, and subplotId on annotation clicks.
    • parcoords emits plotly_hover and plotly_unhover with {x, y, clientX, clientY, dataIndex, curveNumber}, with no points or event.
  • Fixing plotly_beforeplot and plotly_selected is a changes existing types and could break existing code for some users. This wouldn't be a breaking change because it falls under a bug fix.
Lingua principale
JavaScript
Stelle
18.4k
Fork
2.1k
Merge medio
2g 16h
PR unite (30g)
11

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.