Type definition error: Type Date is not assignable to type `Annotations.x`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 18.3k
- Fork
- 2k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 28
Mô tả
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!
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với khai báo Annotations.x trong types/plotly.js/index.d.ts tại các dòng được tham chiếu, sau đó so sánh kiểu của nó với tài liệu về annotation của Plotly. Xác nhận rằng một giá trị Date cho trục ngày tháng được định nghĩa kiểu chấp nhận, và kiểm chứng kết quả bằng một cách sử dụng TypeScript tối thiểu phù hợp với trường hợp được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, typescript
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100