Consider showing UTC offset in tooltip for datetimes
未關閉
還沒有人認領這個 Issue。
feature
P2
- 主要語言
- Python
- 星號
- 18.8k
- 分支
- 2.8k
- 平均合併
- 16 小時 26 分鐘
- 30 天內合併 PR
- 21
描述
Say I have
import pandas as pd
dfa = pd.DataFrame(
{
"datetime": ["2020-10-25T01:30"] * 2,
"price": [40, 50],
}
)
dfa['datetime'] = pd.to_datetime(dfa['datetime']).dt.tz_localize('Europe/London', ambiguous=[True, False])
dfa
datetime price
0 2020-10-25 01:30:00+01:00 40
1 2020-10-25 01:30:00+00:00 50
and I plot
px.scatter(dfa, x="datetime", y="price")
then I get
Notice how the two points are stacked one on top of each other, even though they are actually 1 hour apart
If Plotly's design decision for time zones is to display the local datetime, then I think this makes perfect sense, nice one 👍 However, I think the tooltip should give enough information to distinguish the two points, whereas currently, they both show:
datetime=Oct 25, 2020, 01:30
I would expect the bottom one to show datetime=Oct 25, 2020, 01:30 +01:00 and the top one to show datetime=Oct 25, 2020, 01:30 +00:00
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先執行 issue 中的 Python 重現程式,並檢查 Plotly 如何在 hover tooltip 中格式化 datetime 值。完成的標準是:透過顯示 UTC offset,兩個有歧義的 Europe/London datetime 仍能彼此區分,並為此範例加入 coverage。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- data-visualization
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100