plotly / plotly/angular-plotly.js

event handlers are not typed

Đang mở
#283 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
242
Fork
81
Merge trung bình
8 giờ 48 phút
Pull request đã merge (30 ngày)
18

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong projects/plotly/src/lib/plotly.component.ts tại khai báo output quanh dòng 80 và phần emission quanh dòng 241. Truy vết các event payload được emit bởi output plotlyClick và cung cấp cho các output một kiểu TypeScript có thể sử dụng, đủ rộng cho dữ liệu biểu đồ; hoàn thành nghĩa là consumer không còn thấy event là void, trong khi dữ liệu được emit vẫn được biểu diễn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
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
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.