plotly / plotly/plotly.py

Indicator domain doesn't work in make_subplots()

オープン
#4,710 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

There seems to be a bug with the Indicator class domain/position when used in make_subplots()

I am trying to vertically position 2 indicators in a subplot, so that I have one above the other, but is not working.

Example below is adapted from the indicator example on the plotly website

I also tried { 'type ' : 'domain' } as I read this this might be the issue

version plotly = 5.23

fig made in Jupyter Notebook

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(
    rows=2, cols=2,
    specs=[ [{"type": "indicator"},{"type": "indicator"}] ,
           [{"type": "indicator"}, {"type": "indicator"}], 
          ]
    ,
)

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 200,
    domain = {'x': [0, 0.5], 'y': [0, 0.5]},
    delta = {'reference': 400, 'relative': True, 'position' : "top"}), 
             col =1, 
             row = 1,
             )

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 350,
    delta = {'reference': 400, 'relative': True},
    domain = {'x': [0.5, 1], 'y': [0.5, 1]}), 
              col =1, 
             row = 1,
             
             )

fig.add_trace(go.Indicator(
    mode = "number+delta",
    value = 450,
    title = {"text": "Accounts<br><span style='font-size:0.8em;color:gray'>Subtitle</span><br><span style='font-size:0.8em;color:gray'>Subsubtitle</span>"},
    delta = {'reference': 400, 'relative': True},
    domain = {'x': [0.6, 1], 'y': [0, 1]}), 
              col =2, 
             row = 2,
             )

fig.show()

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供された Python の例を Jupyter Notebook で実行し、make_subplots() が go.Indicator トレースにドメインをどのように割り当てるかを確認します。要求された行と列の位置をレンダリング結果と比較し、次に、説明どおりにインジケーターを垂直方向に配置できること、および例が 4 つのサブプロットセル全体で一貫して動作することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, python
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。