Weird Sankey cycles when nodes are positionned and not ordered by increasing x values
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
I had some strange looking arrows in a Sankey (Plotly v 5.5.0), involving loops. The exact same problem was raised here. After trying different things, I found out the problem occured only when using node positions, and if the nodes in a given loop are not ordered by ascending 'x' position. You may give it a try with this very basic example:
import plotly.graph_objects as go
fig = go.Figure(go.Sankey(
node = {"label": ["First node", "Last node"],
"x": [0.6, 0.2],
"y": [0.2, 0.6]},
link = {
"source": [0, 1],
"target": [1, 0],
"value": [1, 1]
}))
fig.show()
And then replacing the "x" line by:
"x": [0.2, 0.6],
This looks like a bug, which should be fixed ideally. In the meantime, I strive to first order my nodes by ascending X position, which is rather tedious, since I already have to remove nodes without links (or 0 value links) as explained in other open issues. This involves quite a bit of pre-processing unfortunately.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue にある最小限の Python Sankey 例から始め、2 つのノードの x 順序を比較します。Sankey のレンダリングパスを追跡して、位置が逆になるとなぜ壊れたループ矢印が生成されるのかを特定します。両方の順序で、呼び出し元がノードを並べ替える必要なくサイクルが正しくレンダリングされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100