plotly / plotly/plotly.py

Sankey Plot Node Positions are incorrect

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

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

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

説明

Describe your context

  • replace the result of pip list | grep dash below
dash                 1.5.1              
dash-core-components 1.4.0              
dash-html-components 1.0.1              
dash-renderer        1.2.0              
dash-table           4.5.0  

Describe the bug

Want to position Nodes along X-Axis in a Sankey Plot and Y to be automatically Adjusted. When I define X Positions only Sankey doesn't align the Nodes. But If I define Y Positions then only Sankey aligns the Nodes.

    def create_sankey_plot(self, source_r, target_r, value_r, colors_r,
                           labels_r, labels_a, colors_a):
        return go.Sankey(
            node=dict(
                pad=15,
                thickness=20,
                line=dict(color="black", width=0.5),
                label=labels_a,
                color=colors_a,
                x=[0.2, 0.1, 0.5, 0.7, 0.3, 0.5]
            ),
            link=dict(
                source=source_r,
                target=target_r,
                value=value_r,
                color=colors_r,
                line={'width': 1},
                label=labels_r
            )
        )

Above code will not align Nodes. Below code works:

def create_sankey_plot(self, source_r, target_r, value_r, colors_r,
                           labels_r, labels_a, colors_a):
        return go.Sankey(
            node=dict(
                pad=15,
                thickness=20,
                line=dict(color="black", width=0.5),
                label=labels_a,
                color=colors_a,
                x=[0.2, 0.1, 0.5, 0.7, 0.3, 0.5],
                y=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
            ),
            link=dict(
                source=source_r,
                target=target_r,
                value=value_r,
                color=colors_r,
                line={'width': 1},
                label=labels_r
            )
        )

Expected behavior

Align Nodes if provided only X values / Y values making other default.

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

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

はじめの一歩

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

調査の方向性

まず、node.x の値だけを使って報告された go.Sankey のケースを再現し、次に node.y の値も指定する例と比較してください。Python API で公開されている Sankey ノードの位置処理を調査し、一方の座標だけを指定した場合でもノードが整列し、もう一方の座標が自動的に調整されることを確認してください。

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

評価

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

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

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