Type definition error: Type Date is not assignable to type `Annotations.x`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.3k
- Forks
- 2k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 28
Descripción
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!
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comience con la declaración de Annotations.x en types/plotly.js/index.d.ts en las líneas referenciadas y, a continuación, compare su tipo con la documentación de Plotly sobre annotations. Confirme que la definición de tipos acepta un valor Date para un eje de fechas y valide el resultado con un uso mínimo de TypeScript que reproduzca el caso reportado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, typescript
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100