Improper Sankey rendering for certain minimal topologies with loops
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
Sankey engine fails to correctly draw certain graphs containing loops. Attached is a minimal example containing 4 nodes and 5 traces. If any trace value is set to 0, the graph renders correctly.
Tested in python on plotly 5.5.0
import plotly.graph_objects as go
nodes = {'label': ['node 0', 'node 1', 'node 2', 'node 3']}
links = {'source': [0, 1, 2, 2, 3], 'target': [3, 0, 0, 3, 2], 'value': [1, 1, 1, 1, 1]}
go.Figure(go.Sankey(node=nodes, link=links)).show()

In the correct rendering, the trace connecting node 2 to node 0 should be straight across.
This may be related to https://github.com/plotly/plotly.py/issues/3568
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal Python Sankey example in the issue and compare its rendering when all link values are 1 versus when one value is 0. Review the related issue #3568 for context, then trace the Sankey rendering path to determine why the node 2 to node 0 link is not straight; done means the supplied topology renders correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100