[BUG]: The `quiver` trace ignores a discrete `marker.color` array and results in every arrow being black
未关闭
还没有人认领这个 Issue。
bug
P2
size: 3
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
Description
The quiver trace ignores a discrete marker.color array. Every arrow ends up black instead of taking its per-point color. A numeric array with a colorscale works, and a single color string works.
Screenshots/Video
| No colorscale (the bug) | With colorscale (for comparison) |
|---|---|
Steps to reproduce
- Open plotly devtools
- Run the following snippet in the browser devtools console
Plotly.newPlot(gd, [{ type: 'quiver', x: [1, 2, 3], y: [1, 2, 3], u: [1, 1, 1], v: [0, 1, 0], marker: { color: ['rgb(23, 103, 194)', '#FF4136', '#2ECC40'], line: { width: 3 } } }]); - Note that all three arrows are
rgb(0, 0, 0)(by inspection of using your eyes) - Run the following modified snippet:
Plotly.newPlot(gd, [{ type: 'quiver', x: [1, 2, 3], y: [1, 2, 3], u: [1, 1, 1], v: [0, 1, 0], marker: { color: [0, 5, 10], line: { width: 3 } }, colorscale: 'Viridis' }]); - Note that the arrows have the correct color
Notes
marker.coloris documented asarrayOk, so the black arrows seem to be a rendering bug (rather than an unsupported input)- Per the schema, each arrow should be drawn as its own color from the array. If this behavior is intentional, we should update the description.
- This was found while working on #8025
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
通过浏览器开发者工具中的 Plotly.newPlot 调用重现该问题,从 quiver trace 的实现开始。比较离散 marker.color 数组与数值 colorscale 情况下的处理方式,然后验证每个箭头都使用其对应的颜色,同时单色和 colorscales 仍能正常工作。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 72/100