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 摘要。