Type definition error: Type Date is not assignable to type `Annotations.x`
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 18.3k
- Fork
- 2k
- Merge medio
- 2g 12h
- PR unite (30g)
- 28
Descrizione
Hi,
I'm getting typescript error when trying to set Date object for Annotations.x in axis type is date chart.
Note that if you ignore this error and run the program, the position of the X in the annotation will be as expected.
Environments
"plotly.js":"2.28.0""@types/plotly.js":"2.12.32"
Declared here
Document
https://plotly.com/javascript/reference/layout/annotations/#layout-annotations-items-annotation-x
x
Parent: layout.annotations[]
Type: number or categorical coordinate string
Sets the annotation's x position. If the axistypeis "log", then you must take the log of your desired range. If the axistypeis "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axistypeis "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.
SS
Thank you for the support!
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziare con la dichiarazione di Annotations.x in types/plotly.js/index.d.ts alle righe indicate, quindi confrontare il relativo tipo con la documentazione di Plotly sulle annotations. Confermare che un valore Date per un asse temporale sia accettato dalla definizione del tipo e convalidare il risultato con un utilizzo minimo di TypeScript che corrisponda al caso segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100