I am trying to plot Sankey diagrams using Plotly's Sankey functionality. I can get Sankey diagrams to plot properly unless they contain loops (i.e. one state flows back into itself). When a loop occurs the chart sometimes gets cut off in the plot.
Example:
fig = go.Figure(data=[go.Sankey(
node = dict(
pad = 0,
thickness = 10,
line = dict(color = "black", width = 0.5),
label = ["A", "B", "C"],
color = "blue"
),
link = dict(
source = [0, 0, 0 ],
target = [0, 1, 0 ],
value = [8, 4, 2 ]
))])
fig.update_layout(title_text="Cut off loop example", font_size=10)
fig.show()
Notice how the circle is being cut off. I would like to have the plot show the complete circle, is there a way to do this? I have tried adding padding and increasing the size of the plot none of which has resolved the cut off issue.