Ticklabels can not be middle aligned when using a weekly period
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず、報告にある最小限の Python 例を実行し、日次、月次、週次の期間のケースを比較します。週次期間における期間モードの tick-label の配置動作を追跡し、関連する Plotly の実装と回帰テストの場所を特定します。完了の条件は、他の期間のケースが正しいまま、週次ラベルがピクセルベースのシフトなしにレスポンシブに中央揃えされることです。
索引モデルが issue の本文から書いたものです。
説明
Plotly version: 6.2.0
Minimal Example
import plotly.graph_objects as go
import pandas as pd
data = [
{"date": "2025-07-20", "total_sales": 23.34},
{"date": "2025-07-27", "total_sales": 45.21},
{"date": "2025-08-03", "total_sales": 12.98},
{"date": "2025-08-10", "total_sales": 41.32},
]
df = pd.DataFrame.from_records(data)
def make_figure(df, period, step, title):
fig = go.Figure()
fig.add_trace(go.Bar(
x=df['date'],
y=df['total_sales'],
xperiod=period,
xperiod0=df['date'].min(),
xperiodalignment="middle"
))
fig.update_layout(
xaxis={
'ticklabelmode': 'period',
'tickmode': 'linear',
'dtick': period,
'tick0': df['date'].min(),
'ticklabelstep': step
},
title={
'text': title
})
fig.show(renderer="browser")
MS_PER_DAY = 24 * 60 * 60 * 1000
make_figure(df, MS_PER_DAY, 7, "Period = 1 Day")
make_figure(df, MS_PER_DAY * 7, 1, "Period = 7 Days")
When plotting aggregated timeseries data in period mode, the ticklabels are aligned to the middle of the bar when the period is 1 day or even 1 month, but if I try to use a period of 1 week the ticklabels are aligned to the left side of the column.
I cannot use ticklabelshift to move the labels towards the center since ticklabelshift requires the measurement in pixels and what I'm building is repsonsive, so the width of the chart in pixels is variable
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 13時間 41分
- マージ済み PR(30日)
- 21
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.py のほかの issue
-
P3 size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
P3 size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug P1
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
feature P3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
feature P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
plotly/plotly.py の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·