add argument to modify hover box position/direction
未关闭
还没有人认领这个 Issue。
cs
feature
P2
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
Right now developers can't modify the hover box position respective to the point the user is hovering. The hover box position is determined by:
- The numbers in the
"transform=translate(valuex, valuey)"argument of thegelement withclassName="hovertext": https://github.com/plotly/plotly.js/blob/master/src/components/fx/hover.js#L1200 - The shape specified in
din thepathelement (for the triangle orientation): https://github.com/plotly/plotly.js/issues/7278
https://github.com/user-attachments/assets/0634d079-b4eb-4325-af67-d13ac0fc6ba1
Desired behavior:
- Some argument like dcc.Tooltip
direction: https://dash.plotly.com/dash-core-components/tooltip#tooltip-properties - It should also allow diagonal/combined positions ("bottom+right")
# the python way
fig.update_traces(hoverbox_direction="right")
fig.update_traces(hoverbox_direction="left+top")
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 src/components/fx/hover.js 中 className="hovertext" 的 g 元素及其 transform 附近开始,然后查看 issue #7278,了解 hover 三角形的方向。定义方向参数应如何映射到 hover 框和三角形,包括 "left+top" 这样的组合方向;当调用方可以通过所请求的 trace 配置选择这些位置时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization, frontend
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100