Sankey chart cut-off with vertical orientation and set x/y node positions: How to fix?

Hello community,

I have been designing a Dash app using Plotly’s sankey figure. Unfortunately, I am having problems with generating a good responsive sankey figure. Specifically, when using defined x and y node positions together with vertical orientation, the chart is cut-off. Removing the x and y node positions resolves this issue.

Has anyone encountered this or a similar problem?

I have asked this question also on Stackoverflow, though I think reposting here is potentially useful for others too. Here is my SO link:

My code is just a small change to the example code listed on the Plotly website sankey reference (Sankey diagram in Python):

import plotly.graph_objects as go

fig = go.Figure(go.Sankey(
orientation = “v”,
arrangement = “snap”,
node = {
“label”: [“A”, “B”, “C”, “D”, “E”, “F”],
“x”: [0.2, 0.1, 0.5, 0.7, 0.3, 0.5],
“y”: [0.7, 0.5, 0.2, 0.4, 0.2, 0.3],
‘pad’:10}, # 10 Pixels
link = {
“source”: [0, 0, 1, 2, 5, 4, 3, 5],
“target”: [5, 3, 4, 3, 0, 2, 2, 3],
“value”: [1, 2, 1, 1, 1, 1, 1, 2]}))

fig.show()