plotly / plotly/angular-plotly.js
event handlers are not typed
還沒有人認領這個 Issue。
- 主要語言
- TypeScript
- 星號
- 242
- 分支
- 81
- 平均合併
- 8 小時 48 分鐘
- 30 天內合併 PR
- 18
描述
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.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 projects/plotly/src/lib/plotly.component.ts 中第 80 行附近的 output 宣告和第 241 行附近的 emission 開始。追蹤 plotlyClick output 發出的事件 payload,並為 outputs 提供一個可用的 TypeScript 型別,使其範圍足以涵蓋圖表資料;完成的標準是消費者不再將該事件視為 void,同時發出的資料仍獲得表示。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- angular, typescript
- 領域
- frontend
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100