plotly / plotly/angular-plotly.js

event handlers are not typed

Aperta
#283 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
242
Fork
81
Merge medio
8h 48m
PR unite (30g)
18

Descrizione

https://github.com/plotly/angular-plotly.js/blob/5201d97fc2e01e5533d08a921cd44e28265a9222/projects/plotly/src/lib/plotly.component.ts#L80

I was attempting to implement some drill down functionality in the charts in my dashboard. Unfortunately, when I bound a method in my component to the (plotlyClick) output, I noticed that the type of $event was void. But my component method typed the event as unknown anyway, and I console.log the event object, and there is a ton of information in there.

On this line: https://github.com/plotly/angular-plotly.js/blob/master/projects/plotly/src/lib/plotly.component.ts#L241

...I can see that the output indeed is emitting data, just like my logging indicated. Is there anyway we could get these outputs typed? I imagine that the type would be pretty broad due to the amount of different charts/maps out there. But TypeScript thinking that the output is void is probably worse then just not knowing what the event data looks like, but still acknowledging its existence.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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.

Direzione di ricerca

Inizia in projects/plotly/src/lib/plotly.component.ts, alla dichiarazione dell’output intorno alla riga 80 e all’emissione intorno alla riga 241. Traccia i payload degli eventi emessi dall’output plotlyClick e assegna agli output un tipo TypeScript utilizzabile e sufficientemente ampio per i dati del grafico; il lavoro è completato quando i consumer non vedono più l’evento come void, mentre i dati emessi continuano a essere rappresentati.

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

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.