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