go.Sankey not respecting (x,y) coordinates
Open
Nobody has claimed this yet.
bug
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
The code below
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash import Dash
app = Dash(__name__)
def sankey():
x = [0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 1.0]
y = [
0.21630069,
0.47642676,
0.54677235,
0.62167333,
0.74199201,
0.29388136,
0.73906564,
0.89679547,
0.95161119,
0.29388135,
]
label = list("ABCDEFGHIJ")
source = [0, 1, 0, 1, 2, 2, 2, 2, 0, 1, 2, 2, 3, 4, 5, 6, 6, 8]
target = [5, 5, 2, 2, 5, 5, 7, 7, 6, 6, 6, 6, 5, 5, 9, 9, 8, 9]
value = [
4.03086075e-02,
3.13536457e-01,
4.74989358e-03,
4.82905398e-02,
2.57156646e-03,
2.55178406e-02,
1.15108889e-03,
1.17027262e-02,
7.78313638e-03,
7.07743914e-02,
1.02723822e-03,
1.10699730e-02,
1.43875830e-01,
6.19524093e-02,
3.81934471e-01,
2.05828238e-01,
6.19685055e-02,
2.53269630e-17,
]
fig = go.Figure(
data=[
go.Sankey(
arrangement="fixed",
node=dict(
# thickness=20,
# line=dict(color="black", width=0.5),
label=label,
x=x,
y=y,
),
link=dict(source=source, target=target, value=value),
)
]
)
return fig
app.layout = html.Div([dcc.Graph(figure=sankey())])
if __name__ == "__main__":
app.run_server(debug=True)
generates

which is not expected as:
- nodes A,B,C,D and E have all same x coordinates (should be aligned on same vertical line)
- nodes A,B,C,D,E should be ordered from top to bottom as they have increasing y coordinates
I may have misunderstood the (x,y) coordinates logic or it is a bug...
Libraries version:
plotly==4.9.0
dash==1.16.3
dash-core-components==1.12.1
dash-html-components==1.1.1
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 by running the provided Sankey example with the listed plotly, Dash, and component versions, then inspect how arrangement="fixed" applies the supplied node x and y values. Done means nodes A–E share a vertical alignment and appear top-to-bottom in increasing y order, with coverage for the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100