[BUG]: `scattergl` and `splom` hover ignores marker size for overlapping points
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript
研究方向
Reproduce the overlapping-marker example in the browser devtools, then compare scatter/hover.js with the scattergl and splom hover paths. Read the marker sizes computed in scattergl/convert.js and trace how the spatial-tree search uses hoverdistance. Done means WebGL hover ranking matches scatter for marker size and x-hovermode without unintended changes elsewhere.
由索引模型根據 Issue 內容生成。
描述
Description
If markers of different sizes overlap, scatter and scattergl show different hover labels. scatter includes the marker radius in the hover distance, and a smaller marker wins while the pointer is near its center (src/traces/scatter/hover.js). scattergl and splom measure only the distance to the marker center, so the marker drawn on top always wins. scatterpolargl inherits this through scattergl.
scattergl also uses a plain |dx| in x hovermode, but scatter changes the shape of dx inside the marker radius. That difference can rank close points differently.
This is a follow-up to #8077, which fixed ties between equal distances.
Steps to reproduce
- Open Plotly devtools
- Run this snippet in the browser devtools
Plotly.newPlot(gd, {
data: [
{ type: 'scatter', name: 'A', mode: 'markers', marker: { size: 6 }, x: [1], y: [0] },
{ type: 'scatter', name: 'B', mode: 'markers', marker: { size: 20 }, x: [1], y: [0] }
],
layout: { hovermode: 'closest' }
});
- Hover the center of the shared point
- Note that the label shows A
- Change both traces to
type: 'scattergl'and hover again - Note that the label shows B
Notes
- A fix probably means sharing the scoring functions in
scatter/hover.jswithscatterglandsplom - Each marker's radius can be taken from the sizes that
scattergl/convert.jsalready computes - Large traces search a spatial tree within
hoverdistanceof the pointer, so the search box also has to grow by the largest marker radius - This would changed hover results for every WebGL plot with markers of different sizes, so we need to be careful about the blast radius
- 主要語言
- JavaScript
- 星號
- 18.3k
- 分支
- 2k
- 平均合併
- 1 天 14 小時
- 30 天內合併 PR
- 21
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/plotly.js 的其他 Issue
-
chore P3 plotly-internal size: 3 task
難度 2/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆
-
chore P1 plotly-internal size: 1 task
難度 1/5 1 小時以內 新手友好度 82/100
維護者通常 1 天內回覆
-
chore P3 plotly-internal size: 1 task
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 65/100
plotly/plotly.js#7648 · 3 則留言 ·
維護者通常 1 天內回覆
-
bug infrastructure P2
難度 1/5 1 小時以內 新手友好度 65/100
維護者通常 1 天內回覆
相似的 Issue
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
stac-utils/stac-fields#42 ·
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
channels:add check:passed
難度 1/5 1 小時以內 新手友好度 75/100
維護者通常 2 天內回覆