plotly / plotly/plotly.py

ZOrder parameter Breaks Plotly!

未關閉
#5,263 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug P2
主要語言
Python
星號
18.8k
分支
2.8k
平均合併
16 小時 26 分鐘
30 天內合併 PR
21

描述

Hi, if I set zorder=2 or zorder=3 parameter in Candles, Scatter then the Plotly application will be broken!
It happens with Dash and Panel. So I think the problem is woth Plotly itself.
It happens when I regenerate a figure but sometimes it happens when I open an application first time.

I've recorded a video as it's hard to explain.
https://drive.google.com/file/d/1CiBZgWk60Q--nRdtFyQcyXDZFpfjRgv5/view?usp=drive_link

Image Image

Some code:

    fig: go.Figure = make_subplots(rows=6, cols=1, 
                                   shared_xaxes=True,
                                    vertical_spacing=v_subplot_space, # Reduce space between plots
                                    row_heights=row_heights) # Allocate space (Price gets most)

    v_subplot_space = 0.001  # vertical_spacing
    row_heights=[1.0, 0.1, 0.1, 0.1, 0.1, 0.1]

    fig: go.Figure = make_subplots(rows=6, cols=1, 
                                   shared_xaxes=True,
                                    vertical_spacing=0.005, # Reduce space between plots
                                    row_heights=row_heights) # Allocate space (Price gets most)

    # Bollinger Bands
    fig.add_trace(go.Scatter(
        hovertext=candles_df[CandlesTypes.DAY_NAME],
        x=candles_df[CandlesTypes.DATETIME], y=candles_df[CandlesTypes.BB_UPPER], 
        name="BB Upper",
        line=dict(color='rgba(150, 150, 150, 0.5)', width=1,), # Light grey
       zorder=1,
        hoverinfo="skip",
    ), row=1, col=1)

    fig.update_yaxes(
                     row=1, col=1, 
                     )

    fig.update_xaxes(
        dtick="D1",  # Set grid interval to 1 day
        matches='x',
    )

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先將提供的 make_subplots 和 Scatter/Candles 範例縮減為一個可重現的案例,比較在 Dash 和 Panel 中有無 zorder 時的行為。檢查初始載入和圖形重新生成;當 zorder 不再破壞這兩個應用程式中的任何一個時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
plotly, python
領域
data-visualization
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。