event handlers are not typed
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- angular, typescript
- 领域
- frontend
调研方向
从 projects/plotly/src/lib/plotly.component.ts 中第 80 行附近的 output 声明和第 241 行附近的 emission 开始。跟踪 plotlyClick output 发出的事件 payload,并为 outputs 提供一个可用的 TypeScript 类型,使其范围足够覆盖图表数据;完成的标准是消费者不再将该事件视为 void,同时发出的数据仍得到表示。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 242
- 派生
- 81
- 平均合并
- 8 小时 48 分钟
- 30 天内合并 PR
- 18
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/angular-plotly.js 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 45/100
plotly/angular-plotly.js#285 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
plotly/angular-plotly.js#281 · 8 条评论 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 25/100
plotly/angular-plotly.js#278 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 38/100
plotly/angular-plotly.js#276 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
plotly/angular-plotly.js#273 · 1 个 reaction ·