[BUG]: Range slider y-axis "fixed" rangemode renders unexpected thick horizontal bars on initial load
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
Description
When initializing a Plotly chart with an xaxis range slider that has its yaxis.rangemode set to "fixed", the chart initially renders two extra, thick, solid gray horizontal bars stretching across the entire width of the range slider track.
However, this appears to be a visual artifact or initialization bug: if you dynamically toggle the rangemode to "auto" or "match" (via an updatemenu dropdown) and then switch it back to "fixed", the gray bars disappear entirely, and the range slider track displays normally as expected.
Screenshots/Video
Initial render (Buggy):
After toggling to "Auto"/"Match" and back to "Fixed" (Expected):
Steps to reproduce
- Run the provided Python script to generate the Plotly figure.
- Observe the range slider at the bottom of the chart upon initial rendering. Note the unexpected thick gray horizontal bars spanning the slider track.
- Use the dropdown menu in the top-left corner to select "Rangemode: Auto/Match".
- Use the dropdown menu again to select "Rangemode: Fixed".
- Observe that the range slider now looks correct and the gray bars have vanished.
import plotly; print(plotly.__version__) # 6.8.0
import pandas as pd
pd.options.plotting.backend = "plotly"
df = pd.DataFrame(dict(a=[1, 3, 2], b=[3, 2, 1]))
fig = df.plot.line()
fig.update_layout(xaxis=dict(rangeslider=dict(visible=True, yaxis=dict(rangemode="fixed"))))
fig.update_layout(
updatemenus=[
dict(
type="dropdown",
active=1,
buttons=[
dict(
label="Rangemode: Auto",
method="relayout",
args=[{"xaxis.rangeslider.yaxis.rangemode": "auto"}],
),
dict(
label="Rangemode: Fixed",
method="relayout",
args=[{"xaxis.rangeslider.yaxis.rangemode": "fixed"}],
),
dict(
label="Rangemode: match",
method="relayout",
args=[{"xaxis.rangeslider.yaxis.rangemode": "match"}],
),
],
)
]
)
fig.show()
Notes
- Environment: Verified using
plotlyversion6.8.0alongsidepandasplotting backend. - This behavior suggests a missing or improper initialization redraw when
rangemode="fixed"is passed via the initial layout configuration, which is subsequently corrected wheneverrelayouttriggers a fresh calculation of the range slider boundaries.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された Python 再現コードを Plotly 6.8.0 と pandas で実行し、初期の fixed rangemode と、その後の relayout の動作を比較します。range-slider の初期化と redraw パスを追跡して、灰色のバーが初期レンダリング時にのみ表示される理由を特定します。fixed rangemode が初期状態でバーなしにレンダリングされ、モードを切り替えたときも動作が正しいままであれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- pandas, python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 56/100