Customdata in texttemplate could not be found in heatmap
未關閉
還沒有人認領這個 Issue。
bug
P3
- 主要語言
- Python
- 星號
- 18.8k
- 分支
- 2.8k
- 平均合併
- 16 小時 26 分鐘
- 30 天內合併 PR
- 21
描述
For a heatmap chart I want to create a hyperlink, which is provided in the customdata. For some reason it looks like the customdata fields is not accessible from the texttemplate field. Executing the sample code below with browser debug mode shows that customdata is not found:
import plotly.graph_objects as go
labels = ["a", "b", "c"]
z = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
customdata = [["http://google.com", "http://google.com", "http://google.com"], ["http://google.com", "http://google.com", "http://google.com"], ["http://google.com", "http://google.com", "http://google.com"]]
fig = go.Figure(data=go.Heatmap(x=labels, y=labels,
z=z,
customdata=customdata,
texttemplate="""<a href="%{customdata}">%{z}</a>""",
hovertemplate='%{customdata}<extra></extra>',
textfont={"size": 20}))
fig.show()
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從提供的 Python heatmap 範例開始,追蹤 Heatmap customdata 如何傳遞給 texttemplate,並將其與正常運作的 hovertemplate 行為進行比較。透過使用 customdata URL 渲染超連結,並檢查現有的 hover 文字是否仍能正確顯示,確認 fix。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- plotly, python
- 領域
- data-visualization
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100